summaryrefslogtreecommitdiff
path: root/libavcodec/rscc.c
Commit message (Collapse)AuthorAge
* avcodec: Make init-threadsafety the defaultAndreas Rheinhardt2022-07-18
| | | | | | | | | | | and remove FF_CODEC_CAP_INIT_THREADSAFE All our native codecs are already init-threadsafe (only wrappers for external libraries and hwaccels are typically not marked as init-threadsafe yet), so it is only natural for this to also be the default state. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Use union for FFCodec decode/encode callbacksAndreas Rheinhardt2022-04-05
| | | | | | | | | | | This is possible, because every given FFCodec has to implement exactly one of these. Doing so decreases sizeof(FFCodec) and therefore decreases the size of the binary. Notice that in case of position-independent code the decrease is in .data.rel.ro, so that this translates to decreased memory consumption. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Make FFCodec.decode use AVFrame*Andreas Rheinhardt2022-04-05
| | | | | | | | This increases type-safety by avoiding conversions from/through void*. It also avoids the boilerplate "AVFrame *frame = data;" line for non-subtitle decoders. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Add FFCodec, hide internal part of AVCodecAndreas Rheinhardt2022-03-21
| | | | | | | | | | | | | | | | Up until now, codec.h contains both public and private parts of AVCodec. This exposes the internals of AVCodec to users and leads them into the temptation of actually using them and forces us to forward-declare structures and types that users can't use at all. This commit changes this by adding a new structure FFCodec to codec_internal.h that extends AVCodec, i.e. contains the public AVCodec as first member; the private fields of AVCodec are moved to this structure, leaving codec.h clean. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/internal: Move FF_CODEC_CAP_* to a new header codec_internal.hAndreas Rheinhardt2022-03-21
| | | | | | | | | | Also move FF_CODEC_TAGS_END as well as struct AVCodecDefault. This reduces the amount of files that have to include internal.h (which comes with quite a lot of indirect inclusions), as e.g. most encoders don't need it. It is furthemore in preparation for moving the private part of AVCodec out of the public codec.h. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: Constify AVCodecsAndreas Rheinhardt2021-04-27
| | | | | | | | | | Given that the AVCodec.next pointer has now been removed, most of the AVCodecs are not modified at all any more and can therefore be made const (as this patch does); the only exceptions are the very few codecs for external libraries that have a init_static_data callback. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: Factor updating palette outAndreas Rheinhardt2021-03-22
| | | | | | | | | Because the properties of frames returned from ff_get/reget_buffer are not reset at all, lots of returned frames had palette_has_changed wrongly set to 1. This has been changed, too. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec: use the buffer_size_t typedef where requiredJames Almer2021-03-10
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/rscc: Check inflated_buf size whan it is usedMichael Niedermayer2021-02-04
| | | | | | | Fixes: out of array access Fixes: 27434/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RSCC_fuzzer-5196757675540480 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
* avcodec/decode: add a flags parameter to ff_reget_buffer()James Almer2019-09-04
| | | | | | | | | | 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>
* avcodec/rscc: Check that the to be uncompressed input is large enoughMichael Niedermayer2019-04-01
| | | | | | | | | 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>
* libavcodec/rscc.c: add missing semicolonMateusz2019-01-31
| | | | | | Signed-off-by: Mateusz Brzostek <mateuszb@poczta.onet.pl> Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/rscc: Avoid returning frames that have nearly no undamaged pixels in ↵Michael Niedermayer2019-01-28
| | | | | | | | | | | | | 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>
* avcodec/rscc: fix decoding of some iscc filesPaul B Mahol2018-09-08
|
* avcodec/rscc: Skip empty frames (nb_tiles == 0)Michael Niedermayer2018-02-27
| | | | | | | | | | 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>
* avcodec/rscc: Check pixel_size for overflowMichael Niedermayer2017-05-13
| | | | | | | 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>
* Merge commit 'c19830aa2c19f9713b612f7e2fdb437df91ba266'Clément Bœsch2017-03-23
|\ | | | | | | | | | | | | | | | | * commit 'c19830aa2c19f9713b612f7e2fdb437df91ba266': rscc: Support palette format See 11777eb8142117864bff0c8060f17b4089434143 Merged-by: Clément Bœsch <u@pkh.me>
| * rscc: Support palette formatCarl Eugen Hoyos2016-10-02
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avcodec/rscc: return the packet size instead of 0Michael Niedermayer2016-12-15
| | | | | | | | | | | | | | | | 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>
* | avcodec/rscc: Fix constantMichael Niedermayer2016-10-31
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/rscc: Check side data size before useMichael Niedermayer2016-10-31
| | | | | | | | | | | | Fixes out of array read Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavc/rscc: Support pal8 in rscc.Carl Eugen Hoyos2016-09-19
| | | | | | | | Fixes the colours of the sample for ticket #5611.
* | avcodec/rscc: add support for gray8 formatPaul B Mahol2016-09-19
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | lavc/rscc: Fix colourspace for codec_tag RSCC and 32bpp.Carl Eugen Hoyos2016-08-17
| |
* | avcodec/rscc: check input buffer size for deflate modeJames Almer2016-05-10
| | | | | | | | | | | | | | Fixes overreads. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* | Merge commit '51dc4de1218a81ee8e5b3f941839c5e3125a6d4b'Derek Buitenhuis2016-05-08
|\| | | | | | | | | | | | | * commit '51dc4de1218a81ee8e5b3f941839c5e3125a6d4b': rscc: Add extended pixel format support Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * rscc: Add extended pixel format supportVittorio Giovara2016-04-04
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | lavc/rscc: Fix colourspace for codec_tag RSCC.Carl Eugen Hoyos2015-11-22
| |
* | avcodec/rscc: Check input size for raw modeMichael Niedermayer2015-11-14
| | | | | | | | | | | | | | | | 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>
* | Merge commit '533a6198505edd1379e1cd722852350ae4a85acc'Hendrik Leppkes2015-10-27
|/ | | | | | | * commit '533a6198505edd1379e1cd722852350ae4a85acc': innoHeim/Rsupport Screen Capture Codec decoder Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
* innoHeim/Rsupport Screen Capture Codec decoderVittorio Giovara2015-10-23
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>