Vittorio Giovara
def97856de
lavc: AV-prefix all codec capabilities
...
Express bitfields more simply.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 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>
12 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>
12 years ago
Anton Khirnov
36ef5369ee
Replace all CODEC_ID_* with AV_CODEC_ID_*
12 years ago
Ronald S. Bultje
7191e1c490
lagarith: fix color plane inversion for YUY2 output.
12 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.
12 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
Martin Storsjö
00c3b67b8a
cosmetics: Align codec declarations
...
Also break some long lines, remove codec function placeholder comments
and add spaces in sample/pixel format lists.
Signed-off-by: Martin Storsjö <martin@martin.st>
13 years ago
Ronald S. Bultje
0a82f5275f
lagarith: fix buffer overreads.
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
13 years ago
Michael Niedermayer
96d0494123
lagarith: Fix various issues that lead to out of array reads.
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
44bd50f529
lagarith: fix flipped return value
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Martin Storsjö
e9ca85e714
lagarith: Add ff_ prefix to lag_rac_init
...
Signed-off-by: Martin Storsjö <martin@martin.st>
13 years ago
Martin Storsjö
9cf0841ef3
dsputil: Add ff_ prefix to the dsputil*_init* functions
...
Signed-off-by: Martin Storsjö <martin@martin.st>
13 years ago
Michael Niedermayer
69494fd5c5
lagarith: Fix out of array reads.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Paul B Mahol
3c939ad6e0
lagarith: refactor code
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Thad Ward
7af507ea99
lagarith: add decode support for arith rgb24 mode
...
Signed-off-by: Anton Khirnov <anton@khirnov.net>
13 years ago
Michael Niedermayer
0db7b30700
lagarith: rgb24 support
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago