summaryrefslogtreecommitdiff
path: root/libavcodec/xpmdec.c
Commit message (Collapse)AuthorAge
* 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/xpmdec: Move allocations down after more error checksMichael Niedermayer2021-09-05
| | | | | | | | | Fixes: Timeout Fixes: 37035/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XPM_fuzzer-5142718576721920 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: 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/xpmdec: Do not use context dimensions as temporary variablesMichael Niedermayer2019-06-25
| | | | | | | | Fixes: Integer overflow Fixes: 15134/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XPM_fuzzer-5722635939348480 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/xpmdec: define constantsPaul B Mahol2018-12-10
|
* avcodec/xpmdec: fix small artifactsPaul B Mahol2018-12-10
| | | | The max size of uint8_t subset is 223 not 220.
* lavc/xpmdec: Allow more colours per character.Carl Eugen Hoyos2018-12-10
| | | | Fixes ticket #6234.
* avcodec/xpmdec: Fix multiple pointer/memory issuesMichael Niedermayer2017-05-12
| | | | | | | | | Most of these were found through code review in response to fixing 1466/clusterfuzz-testcase-minimized-5961584419536896 There is thus no testcase for most of this. The initial issue was Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: stop using deprecated codec flagsJames Almer2017-03-25
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/xpmdec: there are XPM files with dos line endingsPaul B Mahol2017-03-13
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avcodec/xpmdec: avoid "magic" numbers in function hex_char_to_number()Paul B Mahol2017-03-12
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avcodec/xpmdec: fix colors values which are different for X11Paul B Mahol2017-03-12
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avcodec/xpmdec: do not allow number of colors to be higher than allocatedPaul B Mahol2017-03-12
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avcodec/xpmdec: rename yet another functionPaul B Mahol2017-03-12
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avcodec/xpmdec: rename convert to hex_char_to_numberPaul B Mahol2017-03-12
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avcodec/xpmdec: improve comment for one function and also fix 2 identation ↵Paul B Mahol2017-03-12
| | | | | | issues Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avcodec/xpmdec: skip everything before signaturePaul B Mahol2017-03-12
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avcodec/xpmdec: make convert function more picky about its inputPaul B Mahol2017-03-12
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avcodec: add XPM decoder and demuxerParas Chadha2017-03-12
Signed-off-by: Paras Chadha <paraschadha18@gmail.com>