1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

15 Commits

Author SHA1 Message Date
Michael Niedermayer
2076e11839 avcodec/gdv: Remove unused variable
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-09-30 22:23:02 +02:00
Michael Niedermayer
35517e3ca7 avcodec/gdv: Error out if we had insufficent input for the output frame in 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>
2018-09-28 01:25:17 +02:00
Michael Niedermayer
510bd61941 avcodec/gdv: Optimize 2x scaling loop a little in gdv_decode_frame()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-09-28 01:25:17 +02:00
Michael Niedermayer
6a4788e7b3 avcodec/gdv: Replace loop in gdv_decode_frame() by memcpy()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-09-28 01:25:17 +02:00
Michael Niedermayer
5f84fbce08 avcodec/gdv: Eliminate 50% of the reads in the first inner loop in rescale()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-09-28 01:25:17 +02:00
Michael Niedermayer
d021729efc avcodec/gdv: Simplify first inner loop in rescale()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-09-28 01:25:17 +02:00
Michael Niedermayer
6228ce0a33 avcodec/gdv: Combine first and 3rd case in rescale()
Simplifies code

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-09-28 01:25:17 +02:00
Michael Niedermayer
a423970511 avcodec/gdv: Factor terms out of inner loops in rescale()
This also replaces some loops by memcpy()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-09-28 01:25:17 +02:00
Michael Niedermayer
b90d8cc746 avcodec/gdv: Replace divisions by shifts in rescale()
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>
2018-09-28 01:25:17 +02:00
Michael Niedermayer
cf5a6c754a avcodec/gdv: Check compression before allocating frame
Fixes: 2926/clusterfuzz-testcase-4987110014582784

This reduces decoding time from 7 to 4 seconds

The timeout should have been fixed in 0561bd2fc2 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>
2017-11-03 00:56:30 +01:00
Michael Niedermayer
0561bd2fc2 avcodec/gdv: Check available space before reading palette
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>
2017-08-11 19:27:52 +02:00
Paul B Mahol
4d681269e0 avcodec/gdv: add decompression for 2 and 5 method
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-29 15:54:20 +02:00
Michael Niedermayer
9b65dbf734 avcodec/gdv: Fix undefined shift
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>
2017-06-16 23:32:28 +02:00
Paul B Mahol
9a949cdf8f avcodec/gdv: fix compiler warnings
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-11 10:26:18 +02:00
Paul B Mahol
d1c08027d8 avcodec: add Gremlin Digital Video decoder
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-11 10:00:39 +02:00