Michael Niedermayer
84669b1872
avcodec/iff: Add "else" to make code look prettier
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years ago
Michael Niedermayer
f76d7352e0
avcodec/iff: Check ham vs bpp
This checks the ham value much stricter and avoids hitting cases which cannot be reached
with data from the libavformat demuxer.
Fixes: out of array access
Fixes: 15320/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5080476840099840
Fixes: 15423/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5630765833912320
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years ago
Michael Niedermayer
0f9789c8e3
avcodec/iff: finetune the palette size check in the mask case
Fixes: out of array access
Fixes: 15381/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5668057826983936
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years ago
Michael Niedermayer
92e8db532c
avcodec/iff: Fix mask_buf / mask_palbuf leak
Fixes: 15372/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5708881759567872
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years ago
Michael Niedermayer
9a6503f496
avcodec/iff: Cleanup on init failure
Fixes: memleak
Fixes: 2272/clusterfuzz-testcase-minimized-5059103858622464
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
Clément Bœsch
549045254c
Fix all -Wformat warnings raised by DJGPP
9 years ago
Paul B Mahol
5979fb0b1e
avcodec/iff: support for byterun1 ACBM compression
This is apparently same as no compression.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
9 years ago
Paul B Mahol
49633f9f74
avcodec/iff: add support for vertical word compression in ILBM
Signed-off-by: Paul B Mahol <onemda@gmail.com>
9 years ago
Paul B Mahol
0ea03dbbf9
avcodec/iff: remove palette swapping for anim
It appears it is wrong.
9 years ago
Michael Niedermayer
a2550e7d2e
avcodec/iff: Check that there are enough bytes in dgb before reading
Fixes CID1361959
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
9585c50942
avcodec/iff: remove useless ()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
55ef890b29
avcodec/iff: Print error for cols/bpp/bytes being bad in decode_delta_j()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
fcdbbbd85a
avcodec/iff: decode_delta_j: Check that the number of bytes that will be read are available
This should avoid long loops
related to CID1361958
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
c3ad63c6a3
avcodec/iff: Fix bytestream advance
Fixes Ticket5585
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Piotr Bandurski
854c405dab
avcodec/iff: mention RGB8/RGBN decoder
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Paul B Mahol
a5c5ae5ed8
avcodec/iff: add support for ANBR files
Signed-off-by: Paul B Mahol <onemda@gmail.com>
9 years ago
Paul B Mahol
810a8ba5b6
avcodec/iff: add forgotten checks for end of input buffer
Signed-off-by: Paul B Mahol <onemda@gmail.com>
9 years ago
Paul B Mahol
eef2f64294
avcodec/iff: scala anim32 & anim16 decompression
Signed-off-by: Paul B Mahol <onemda@gmail.com>
9 years ago
Paul B Mahol
95b20ad7b2
avcodec/iff: fix artifacts with uncompressed ham ANIMs
Signed-off-by: Paul B Mahol <onemda@gmail.com>
9 years ago
Paul B Mahol
72e33eec3a
avcodec/iff: add support for ANIMs with keyframes and concatenated ANIMs
Signed-off-by: Paul B Mahol <onemda@gmail.com>
9 years ago
Paul B Mahol
8767470fb5
avcodec/iff: check if there is enough bytes left
Signed-off-by: Paul B Mahol <onemda@gmail.com>
9 years ago
Paul B Mahol
5350e0fc97
avcodec/iff: rewrite out of bounds checking in writer
Signed-off-by: Paul B Mahol <onemda@gmail.com>
9 years ago
Paul B Mahol
51a1c1c6ac
avcodec/iff: check for end of buffer in input for delta_l decompression
Signed-off-by: Paul B Mahol <onemda@gmail.com>
9 years ago
Paul B Mahol
01ead2a639
avcodec/iff: implement 3rd delta ANIM decompression
Signed-off-by: Paul B Mahol <onemda@gmail.com>
9 years ago
Paul B Mahol
17ea1cd559
avcodec/iff: change delta l offset to uint32_t
Signed-off-by: Paul B Mahol <onemda@gmail.com>
9 years ago
Paul B Mahol
cb928fc448
lavc: add IFF ANIM decoder
Signed-off-by: Paul B Mahol <onemda@gmail.com>
9 years ago
Alexandra Hájková
5c31eaa999
Remove unnecessary get_bits.h #includes and add missing headers where needed.
Signed-off-by: Diego Biurrun <diego@biurrun.de>
9 years ago
Andreas Cadhalpun
ec0275843d
avcodec: remove leftover iff_byterun1 decoder
It was merged with the iff_ilbm decoder in commit
929a24efff .
Define AV_CODEC_ID_IFF_BYTERUN1 as AV_CODEC_ID_IFF_ILBM for API
compatibility.
Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
10 years ago
Vittorio Giovara
059a934806
lavc: Consistently prefix input buffer defines
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
10 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
Diego Biurrun
7f9f771eac
avcodec: Don't anonymously typedef structs
11 years ago
Michael Niedermayer
3539d6c63a
avcodec/iff: check pixfmt for rgb8 / rgbn
Fixes out of array access
Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
9bcdb98839
avcodec/iff: Factorize av_pix_fmt_desc_get() out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
4843227b2c
avcodec/iff: ensure that runs with insufficient input dont leave uninitialized bytes in the output
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7fa0dea15eae_8988_test.iff
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
b3f44eafa5
avcodec/iff: warn about truncated input to decode_byterun() and clear remaining output
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7fe205e395ed_8988_test.iff
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Diego Biurrun
8f8bc92365
Add missing #includes for *INT64_MAX and *INT64_C
12 years ago
Anton Khirnov
4b8a194146
iff: use the AVFrame API properly.
12 years ago
Michael Niedermayer
d5ec8ba7f2
Do not leave positive values undefined when negative are defined as error
Define positive return values as non errors and leave further meaning undefined
This allows future extensions to use these values
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Diego Biurrun
b2bed9325d
cosmetics: Group .name and .long_name together in codec/format declarations
12 years ago
Luca Barbato
7d65e960c7
iff: Do not read over the source buffer
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
12 years ago
Luca Barbato
3865ba7b21
iff: K&R formatting cosmetics
12 years ago
Paul B Mahol
a9b424879f
lavc & lavf: replace deprecated av_log* functions
Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 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.
13 years ago
Anton Khirnov
3b199d29cd
lavc decoders: properly initialize AVFrame.
13 years ago
Anton Khirnov
759001c534
lavc decoders: work with refcounted frames.
13 years ago
Piotr Bandurski
f9a8eeb08c
iff/deep: fix rle32 on big-endian
Fixes ticket #2197 .
Signed-off-by: Peter Ross <pross@xvid.org>
13 years ago
Paul B Mahol
07a7145d89
lavc/iff: rgbn: fix decoding on big endian
Fixes #2193 .
Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 years ago
Anton Khirnov
04e1249609
iff: drop ff_ prefix from a static function.
13 years ago
Paul B Mahol
25c75525bf
lavc/iff: ilbm: unbreak decoding on big endian
Fixes #2192 .
Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 years ago
Peter Ross
7016aa655b
iff decoder: support RGB8 and RGBN
13 years ago