Commit Graph

22 Commits

Author SHA1 Message Date
James Almer
9ea6d2149e avcodec/decode: add a flags parameter to ff_reget_buffer()
Some decoders may not need a writable buffer in some specific cases, but only
a reference to the existing buffer with updated frame properties instead, for
the purpose of returning duplicate frames. For this, the
FF_REGET_BUFFER_FLAG_READONLY flag is added, which will prevent potential
allocations and buffer copies when they are not needed.

Signed-off-by: James Almer <jamrial@gmail.com>
2019-09-04 10:07:12 -03:00
Michael Niedermayer
3a0ec1511e avcodec/rscc: Check that the to be uncompressed input is large enough
Fixes: Out of array access
Fixes: 13984/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RSCC_fuzzer-5734128093233152

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>
2019-04-01 10:30:06 +02:00
Mateusz
fe1ccc1e91 libavcodec/rscc.c: add missing semicolon
Signed-off-by: Mateusz Brzostek <mateuszb@poczta.onet.pl>
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-31 17:16:39 +01:00
Michael Niedermayer
eb1f95eb35 avcodec/rscc: Avoid returning frames that have nearly no undamaged pixels in them
Fixes: Timeout
Fixes: 12192/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RSCC_fuzzer-6279038004363264

Before: clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RSCC_fuzzer-6279038004363264 in 15423 ms
After:  clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RSCC_fuzzer-6279038004363264 in 190 ms

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-28 01:09:38 +01:00
Paul B Mahol
068412f2e8 avcodec/rscc: fix decoding of some iscc files 2018-09-08 17:27:40 +02:00
Michael Niedermayer
bbed942dfd avcodec/rscc: Skip empty frames (nb_tiles == 0)
Fixes: Timeout
Fixes: 6266/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RSCC_fuzzer-5692431816196096

Its not known if nb_tiles is allowed so it is not treated as an error

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-02-27 12:23:23 +01:00
Michael Niedermayer
934572c5c3 avcodec/rscc: Check pixel_size for overflow
Fixes: 1509/clusterfuzz-testcase-minimized-5129419876204544

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-13 01:32:55 +02:00
Clément Bœsch
5f044d2372 Merge commit 'c19830aa2c19f9713b612f7e2fdb437df91ba266'
* commit 'c19830aa2c19f9713b612f7e2fdb437df91ba266':
  rscc: Support palette format

See 11777eb814

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-23 11:33:27 +01:00
Michael Niedermayer
c62beba49a avcodec/rscc: return the packet size instead of 0
Most decoders return the amount of data used.
This is more consistent

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-15 22:10:40 +01:00
Michael Niedermayer
e167610794 avcodec/rscc: Fix constant
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-31 23:20:31 +01:00
Michael Niedermayer
0f64b6cd22 avcodec/rscc: Check side data size before use
Fixes out of array read

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-31 01:11:03 +01:00
Carl Eugen Hoyos
c19830aa2c rscc: Support palette format
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-10-02 15:42:03 -04:00
Carl Eugen Hoyos
11777eb814 lavc/rscc: Support pal8 in rscc.
Fixes the colours of the sample for ticket #5611.
2016-09-19 23:26:06 +02:00
Paul B Mahol
590f025b3d avcodec/rscc: add support for gray8 format
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-09-19 18:31:45 +02:00
Carl Eugen Hoyos
a810126fd1 lavc/rscc: Fix colourspace for codec_tag RSCC and 32bpp. 2016-08-17 22:10:45 +02:00
James Almer
b2244fa0a6 avcodec/rscc: check input buffer size for deflate mode
Fixes overreads.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-05-10 22:07:19 -03:00
Derek Buitenhuis
dd2d26dc82 Merge commit '51dc4de1218a81ee8e5b3f941839c5e3125a6d4b'
* commit '51dc4de1218a81ee8e5b3f941839c5e3125a6d4b':
  rscc: Add extended pixel format support

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-05-08 23:33:08 +01:00
Vittorio Giovara
51dc4de121 rscc: Add extended pixel format support
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-04-04 15:39:51 +02:00
Carl Eugen Hoyos
f5074dd39c lavc/rscc: Fix colourspace for codec_tag RSCC. 2015-11-22 01:44:18 +01:00
Michael Niedermayer
ac6ab77741 avcodec/rscc: Check input size for raw mode
Fixes out of array read
Fixes: 7fcd09eadd046e326d8ea0af66f166c8/asan_heap-oob_4a52e5_2273_fa6078a10dd575df266fb1e0b4114cd5.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-14 18:26:11 +01:00
Hendrik Leppkes
8b3228a329 Merge commit '533a6198505edd1379e1cd722852350ae4a85acc'
* commit '533a6198505edd1379e1cd722852350ae4a85acc':
  innoHeim/Rsupport Screen Capture Codec decoder

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-27 13:58:44 +01:00
Vittorio Giovara
533a619850 innoHeim/Rsupport Screen Capture Codec decoder
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-23 14:56:43 +02:00