Michael Niedermayer
5859b5b439
avcodec/lagarith: Detect end of input in lag_decode_line() loop
...
Fixes: timeout
Fixes: 2933/clusterfuzz-testcase-5124990208835584
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years ago
Michael Niedermayer
948b54763b
avcodec/lagarith: Fix runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
...
Fixes: 1764/clusterfuzz-testcase-minimized-5394243164045312
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Michael Niedermayer
ed3c9b5b0d
avcodec/lagarith: Check scale_factor
...
Fixes: 1425/clusterfuzz-testcase-minimized-6295712339853312
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Michael Niedermayer
ddb2dd7edb
avcodec/lagarith: Fix runtime error: left shift of negative value -1
...
Fixes: 1424/clusterfuzz-testcase-minimized-6088327159611392
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Ronald S. Bultje
081c21ca55
lagarith: assign correct per-thread value to LagarithContext::avctx.
...
This fixes race conditions reported by tsan in fate-lagarith. The races
were because each thread's LagarithContext::avctx was set to the first
thread's AVCodecContext.
8 years ago
Diego Biurrun
a25dac976a
Use bitstream_init8() where appropriate
8 years ago
James Almer
47f212329e
huffyuvdsp: move functions only used by huffyuv from lossless_videodsp
...
Signed-off-by: James Almer <jamrial@gmail.com>
8 years ago
James Almer
5ac1dd8e23
lossless_videodsp: move shared functions from huffyuvdsp
...
Several codecs other than huffyuv use them.
Signed-off-by: James Almer <jamrial@gmail.com>
8 years ago
Alexandra Hájková
6fad5abcad
lagarith: Convert to the new bitstream reader
8 years ago
Vittorio Giovara
41ed7ab45f
cosmetics: Fix spelling mistakes
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
9 years ago
Vittorio Giovara
def97856de
lavc: AV-prefix all codec capabilities
...
Express bitfields more simply.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
10 years ago
Michael Niedermayer
35dcc8a040
avcodec/lagarith: fix integer overflow
...
Fixes: asan_heap-oob_1bf48fa_2513_lag-yuy2.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
e981de81fe
avcodec/lagarith: fix chroma plane width & height
...
Fixes out of array read
Fixes: asan_heap-oob_1bf48fa_2513_lag-yuy2.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Diego Biurrun
0d439fbede
dsputil: Split off HuffYUV decoding bits into their own context
...
Also shorten HuffYUV context member names to avoid clutter.
11 years ago
Diego Biurrun
4f4840377f
lagarith: Fix typo in printf format string
...
libavcodec/lagarith.c:671:16: warning: '#' flag used with ‘%u’ gnu_printf format [-Wformat]
11 years ago
Diego Biurrun
cc8163e1a3
avcodec: more correct printf specifiers
11 years ago
Anton Khirnov
4c3e1956ee
lagarith: reallocate rgb_planes when needed
...
Fixes invalid writes on pixel format changes.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
11 years ago
Kostya Shishkov
2f97094608
lagarith: do not call simd functions on unaligned lines
...
They end up overwriting past the line end.
Partially based on a patch by Michael Niedermayer <michaelni@gmx.at>
Bug-Id: vlc/9700
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
11 years ago
Michael Niedermayer
61d43a2651
avcodec/lagarith: check and propagate return value from init_get_bits8()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
afd1245433
avcodec/lagarith: use init_get_bits8()
...
Suggested-by: Reimar
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
6f1b296771
avcodec/lagarith: reenable buggy lag_decode_zero_run_line()
...
This is to prevent regressions in case the old code was able to partly
decode frames (no way to say without a testcase)
Add a memset to prevent use of uninitialized memory until we have a
testcase and can test/fix it
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
e80aa47abf
avcodec/lagarith: fix init_get_bits() size in lag_decode_arith_plane()
...
untested due to lack of sample
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
3410122c68
avcodec/lagarith: fix src/src_size for esc_count < 8
...
untested due to lack of sample
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
100a54da52
avcodec/lagarith: disable lag_decode_zero_run_line() and ask for a sample
...
The code seems to have never been tested
fixing it should be quite easy but needs a sample/testcase
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f9a862dfabf_413_2889_assassin_OL.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Diego Biurrun
b2bed9325d
cosmetics: Group .name and .long_name together in codec/format declarations
11 years ago
Michael Niedermayer
45f0623ae3
avcodec/lagarith: check scaled probabilities
...
Prevents infinite loop
Fixes Ticket2988
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Carl Eugen Hoyos
f381dc1d61
Support decoding of Lagarith frame type FRAME_SOLID_COLOR.
...
Fixes bug 459.
12 years ago
Clément Bœsch
1ec94b0f06
lavc: factorize ff_{thread_,re,}get_buffer error messages.
...
Coccinelle profile used:
@@
expression r, ctx, f, loglevel, str, flags;
@@
-if ((r = ff_get_buffer(ctx, f, flags)) < 0) {
- av_log(ctx, loglevel, str);
- return r;
-}
+if ((r = ff_get_buffer(ctx, f, flags)) < 0)
+ return r;
@@
expression r, ctx, f, loglevel, str;
@@
-if ((r = ff_reget_buffer(ctx, f)) < 0) {
- av_log(ctx, loglevel, str);
- return r;
-}
+if ((r = ff_reget_buffer(ctx, f)) < 0)
+ return r;
@@
expression r, ctx, f, loglevel, str, flags;
@@
-if ((r = ff_thread_get_buffer(ctx, f, flags)) < 0) {
- av_log(ctx, loglevel, str);
- return r;
-}
+if ((r = ff_thread_get_buffer(ctx, f, flags)) < 0)
+ return r;
...along with some manual patches for the remaining ones.
12 years ago
Anton Khirnov
759001c534
lavc decoders: work with refcounted frames.
12 years ago
Paul B Mahol
c4274d118b
lagarith: return more meaningful error codes
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Carl Eugen Hoyos
40297a8bdb
Support solid gray frames when decoding Lagarith.
...
Fixes bug 431.
12 years ago
Diego Biurrun
511cf612ac
miscellaneous typo fixes
12 years ago
Anton Khirnov
df9b956751
lavc: fix decode_frame() third parameter semantics for video decoders
...
It's got_frame, not data size
12 years ago
Michael Niedermayer
9eef41b848
lagarith: always allocate for 4 planes. Fixes out of array accesses
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
2d71f31df2
lag_read_prob_header: fix out of array access
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Anton Khirnov
716d413c13
Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat
12 years ago
Michael Niedermayer
b631e4ed64
lagarith: check count before writing zeros.
...
Fixes CVE-2012-2793
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton@khirnov.net>
12 years ago
Michael Niedermayer
2b3b52d519
lagarith: fix alignment on buffers passed into prediction dsp code.
...
This should fix issues with direct rendering
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Hendrik Leppkes
f9150c8ac0
lagarith: frame multithreading
...
About 2x speedup going from 1 to 2 threads.
1.7s to 0.85s on foreman CIF.
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
13 years ago
Anton Khirnov
36ef5369ee
Replace all CODEC_ID_* with AV_CODEC_ID_*
13 years ago
Ronald S. Bultje
7191e1c490
lagarith: fix color plane inversion for YUY2 output.
13 years ago
Ronald S. Bultje
98d0d19208
lagarith: pad RGB buffer by 1 byte.
...
For left HFYU prediction, we predict from the buffer buf+1 using 8- or
16-byte reads. This means that aligning the buffer by 16 bytes is in
itself not sufficient, because if the width itself is 16- or 8-byte
aligned, the buffer will not be padded, and thus a read of size 16 at
buf+1 will overflow boundaries at the right edge. Padding the buffer by
1 byte is sufficient to not overflow its boundaries.
Fixes bug 342.
13 years ago
Lou Logan
6851130fd6
cosmetics: minor libavcodec spelling errors
...
Also update some common misspelled words in patcheck
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Hendrik Leppkes
f6943f2379
lagarith: frame multithreading
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Carl Eugen Hoyos
eae77f4631
Fix lagarith YUY2 output.
13 years ago
Kostya Shishkov
464e9ab011
lagarith: add YUY2 decoding support
...
Unlike other variants, for YUY2 we need to use different prediction:
* on line 0 for luma we should left predict starting from the second pixel
* on line 1 we should left predict first 4 pixels for luma and 2 for chroma
* median prediction employed here is taken directly from HuffYUV
13 years ago
Carl Eugen Hoyos
58637a0b24
Support decoding unaligned rgb24 lagarith.
...
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
13 years ago
Kostya Shishkov
1fdb5649d9
lagarith: make offset array type unsigned
...
This is logical and also fixes checking for the fourth plane offset.
13 years ago
Carl Eugen Hoyos
8cb9f99e9f
Support decoding unaligned rgb24 lagarith.
...
Fixes ticket #1214 .
13 years ago
Michael Niedermayer
83c7803f55
lagarith: check count before writing zeros.
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago