summaryrefslogtreecommitdiff
path: root/libavcodec/gdv.c
Commit message (Collapse)AuthorAge
* avcodec: use the buffer_size_t typedef where requiredJames Almer2021-03-10
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/gdv: Remove dead checkAndreas Rheinhardt2020-11-10
| | | | | | | | | | | | | At the end of its decode function, the decoder sets *got_frame to 1 and then checks whether ret is < 0; if so, it is returned, otherwise avpkt->size is. But it is impossible for ret to be < 0 here and if it were, it would be nonsense to set *got_frame to 1 before this. Therefore just return avpkt->size unconditionally. Fixes Coverity issue #1439730. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/gdv: Replace assert() checking bitstream by if()Michael Niedermayer2019-09-16
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/gdv: Check remaining output after decode 5/6/8/Michael Niedermayer2019-05-31
| | | | | | | | Improves: Timeout (355sec -> 97sec) Improves: 14709/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GDV_fuzzer-5704215281795072 Reviewed-by: Paul B Mahol <onemda@gmail.com> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
* avcodec/gdv: Check input palette size before rescale()Michael Niedermayer2019-04-26
| | | | | | | | | Fixes: Timeout (22sec -> 11sec) Fixes: 13576/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GDV_fuzzer-5681024577568768 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/gdv: Check for truncated tags in decompress_5()Michael Niedermayer2019-03-03
| | | | | | | Testcase: 13169/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GDV_fuzzer-5666354038833152 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/gdv: Optimize and factorize scaling loopsMichael Niedermayer2019-01-14
| | | | | | | | | | | Fixes: Timeout Fixes: 11067/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GDV_fuzzer-5686623711264768 Before change: Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GDV_fuzzer-5686623711264768 in 34386 ms After change: Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GDV_fuzzer-5686623711264768 in 24327 ms Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/gdv: Optimize unscaled loopMichael Niedermayer2019-01-05
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/gdv: Remove unused variableMichael Niedermayer2018-09-30
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/gdv: Error out if we had insufficent input for the output frame in ↵Michael Niedermayer2018-09-28
| | | | | | | | | | decompress_2() Fixes: Timeout (with the previous commits to gdv.c) Fixes: 9422/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GDV_fuzzer-5143490001371136 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/gdv: Optimize 2x scaling loop a little in gdv_decode_frame()Michael Niedermayer2018-09-28
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/gdv: Replace loop in gdv_decode_frame() by memcpy()Michael Niedermayer2018-09-28
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/gdv: Eliminate 50% of the reads in the first inner loop in rescale()Michael Niedermayer2018-09-28
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/gdv: Simplify first inner loop in rescale()Michael Niedermayer2018-09-28
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/gdv: Combine first and 3rd case in rescale()Michael Niedermayer2018-09-28
| | | | | | Simplifies code Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/gdv: Factor terms out of inner loops in rescale()Michael Niedermayer2018-09-28
| | | | | | This also replaces some loops by memcpy() Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/gdv: Replace divisions by shifts in rescale()Michael Niedermayer2018-09-28
| | | | | | | Divisions tend to be slower than shifts unless the compiler optimizes them out. And some of these are in inner loops. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/gdv: Check compression before allocating frameMichael Niedermayer2017-11-03
| | | | | | | | | | | | Fixes: 2926/clusterfuzz-testcase-4987110014582784 This reduces decoding time from 7 to 4 seconds The timeout should have been fixed in 0561bd2fc2bff0dbe651d5998e9f129c43d25eb3 but ossfuzz did not close this issue Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/gdv: Check available space before reading paletteMichael Niedermayer2017-08-11
| | | | | | | | Fixes: Timeout Fixes: 2926/clusterfuzz-testcase-498711001458278 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/gdv: add decompression for 2 and 5 methodPaul B Mahol2017-06-29
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avcodec/gdv: Fix undefined shiftMichael Niedermayer2017-06-16
| | | | | | | | Fixes: runtime error: left shift of 255 by 24 places cannot be represented in type 'int' Fixes: 2249/clusterfuzz-testcase-minimized-5388542379294720 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/gdv: fix compiler warningsPaul B Mahol2017-06-11
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avcodec: add Gremlin Digital Video decoderPaul B Mahol2017-06-11
Signed-off-by: Paul B Mahol <onemda@gmail.com>