aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/jpeg2000dec.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/jpeg2000dec: Skip de-quantization of empty areasMichael Niedermayer2019-03-251-0/+2
| | | | | | | | Fixes: Timeout (26sec -> 18sec) Fixes: 13448/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-576903098243481 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeg2000dec: Skip DWT if nothing is codedMichael Niedermayer2018-12-081-4/+8
| | | | | | | | | | Improves speed in uncommon case Fixes: Timeout Fixes: 10964/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5132066034286592 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeg2000dec: Fix off by 1 error in JPEG2000_PGOD_CPRL handlingMichael Niedermayer2018-10-231-1/+1
| | | | | | | | Fixes: assertion failure Fixes: 10785/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5672160496975872 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeg2000dec: Fixes invalid shifts in ↵Michael Niedermayer2018-07-041-4/+4
| | | | | | | | | | jpeg2000_decode_packets_po_iteration() Fixes: shift exponent 47 is too large for 32-bit type 'int' Fixes: 9163/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5661750182543360 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeg2000dec: Check that there are enough bytes for all tilesMichael Niedermayer2018-07-041-1/+4
| | | | | | | | Fixes: OOM Fixes: 8781/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5810709081358336 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/jpeg2000dec: Move a variable declaration closer to its usage.Carl Eugen Hoyos2018-05-221-1/+1
|
* lavc/jpeg2000dec: Use a define to clarify the meaning of a constant.Carl Eugen Hoyos2018-05-221-1/+1
|
* avcodec/jpeg2000dec: Fix undefined shift in the ↵Michael Niedermayer2018-05-061-2/+2
| | | | | | | | | | jpeg2000_decode_packets_po_iteration() CPRL case Fixes: shift exponent 47 is too large for 32-bit type 'int' Fixes: 7955/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-6016721977606144 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeg2000dec: Skip init for component in CPRL if nothing is to be doneMichael Niedermayer2018-05-061-0/+3
| | | | | | | | Fixes: assertion failure Fixes: 7949/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-4819602782552064 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeg2000dec: Reduce the number of tile parts allocatedMichael Niedermayer2018-05-061-2/+5
| | | | | | | | | | | | | | This is large enough for all jpeg2000 files i tested. If some need more then this should be changed to dynamic allocation. Dynamic allocation would need to be done carefully as these are many relatively small arrays so repeatly reallocating them would not be good. The decrease is a clean and simple solution assuming it works for all files. Fixes: OOM Fixes: 6534/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-4821490731057152 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeg2000dec: Use av_image_check_size2()Michael Niedermayer2018-02-171-1/+1
| | | | | | | | Fixes: OOM Fixes: 5733/clusterfuzz-testcase-minimized-4906757966004224 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: do not use init_static_data on some codecsMuhammad Faiz2018-02-041-7/+9
| | | | | | | | | | | | | | They don't modify AVCodec, no needs to call it at register. They will be wasteful if these codecs are unused. Instead, call static data initialization at codecs' init. Benchmark: old: 51281340 decicycles in avcodec_register_all, 1 runs, 0 skips new: 6738960 decicycles in avcodec_register_all, 1 runs, 0 skips Reviewed-by: wm4 <nfxjfg@googlemail.com> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
* lavc/jpeg2000dec: Support reading 64-bit atom size.Carl Eugen Hoyos2017-12-281-1/+10
| | | | Fixes ticket #6935.
* avcodec/jpeg2000dec: Free lengthinc earlierMichael Niedermayer2017-12-211-0/+3
| | | | | | Reduces memory needed Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeg2000dec: Allocate lengthinc and data_start arrays as neededMichael Niedermayer2017-12-211-0/+9
| | | | | | | | | Decreases memory requirements Fixes: OOM Fixes: 4525/clusterfuzz-testcase-minimized-6400713073623040 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeg2000: Dynamically allocate codeblock dataMichael Niedermayer2017-11-221-3/+19
| | | | | | | | | | | Fixes: OOM Fixes: 3541/clusterfuzz-testcase-minimized-6469958596820992 Adds support for decoding codeblock data larger than 8kb Reduces decoder memory consumption Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/jpeg2000dec: Fix used variables reading palette.Carl Eugen Hoyos2017-11-121-2/+2
| | | | Affected files with palette and colour-depth < 8.
* avcodec/jpeg2000dec: Fix h/vden typoMichael Niedermayer2017-07-271-1/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeg2000dec: Fix division by zero in jp2_find_codestream()Michael Niedermayer2017-07-261-0/+5
| | | | | | | Fixes: 2707/clusterfuzz-testcase-minimized-5179636394754048 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/jpeg2000dec: Read the sample aspect ratio from the jp2 resolution box.Carl Eugen Hoyos2017-07-181-0/+33
|
* avcodec/jpeg2000dec: Check nonzerobits more completelyMichael Niedermayer2017-06-161-2/+2
| | | | | | | | Fixes: runtime error: shift exponent 36 is too large for 32-bit type 'int' Fixes: 2239/clusterfuzz-testcase-minimized-5639766592716800 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeg2000dec: Use ff_set_dimensions()Michael Niedermayer2017-05-291-4/+8
| | | | | | | | Fixes: OOM Fixes: 1890/clusterfuzz-testcase-minimized-6329019509243904 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeg2000dec: Check tile offsets more completelyMichael Niedermayer2017-05-281-1/+4
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeg2000dec: Fix copy and paste errorMichael Niedermayer2017-05-251-2/+1
| | | | | Found-by: jamrial Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeg2000dec: Check tile offsetsMichael Niedermayer2017-05-241-0/+8
| | | | | | | Fixes: runtime error: signed integer overflow: 4096 - -2147483648 cannot be represented in type 'int' Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/jpeg2000dec: Fix jp2 inner atom size used for overread checks.Carl Eugen Hoyos2017-05-031-0/+1
|
* avcodec/jpeg2000dec: add slice threading supportPaul B Mahol2016-03-251-7/+8
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avcodec/jpeg2000dec: account two last bytes from end of bytestream as EOC markerPaul B Mahol2016-03-251-2/+2
| | | | | | This silences missing EOC marker when decoding j2k files with Psot set to 0. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avcodec/jpeg2000dec: More completely check cdefMichael Niedermayer2016-01-271-5/+9
| | | | | | | | Fixes out of array read Fixes: j2k-poc.bin Found-by: Lucas Leong <wmliang.tw@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '2c6811397bdf13d43ca206e48d6d6da9c2cd47c6'Hendrik Leppkes2016-01-011-10/+2
|\ | | | | | | | | | | | | * commit '2c6811397bdf13d43ca206e48d6d6da9c2cd47c6': lavc: add profiles to AVCodecDescriptor Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavc: add profiles to AVCodecDescriptorAnton Khirnov2015-12-121-10/+2
| | | | | | | | | | The profiles are a property of the codec, so it makes sense to export them through AVCodecDescriptors, not just the codec implementations.
| * jpeg2000: Refactor decode_packetsLuca Barbato2015-09-141-65/+83
| | | | | | | | Move the packet-specific parsers in separate functions.
* | avcodec/jpeg2000dec: Check bpno in decode_cblk()Michael Niedermayer2015-12-041-0/+4
| | | | | | | | | | | | | | | | Fixes: undefined shift Fixes: c409ef86f892335a0a164b5871174d5a/asan_heap-oob_1dff564_2159_162b7234616deab02b544410455eb07b.mov Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/jpeg2000: Change coord to 32bit to support larger than 32k width or ↵Michael Niedermayer2015-11-151-1/+2
| | | | | | | | | | | | | | | | | | height Fixes: 03e0abe721b1174856d41a1eb5d6a896/signal_sigabrt_7ffff6ae7cc9_3813_e71bf3541abed3ccba031cd5ba0269a4.avi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/jpeg2000dec: Fix potential integer overflow with tile dimensionsMichael Niedermayer2015-11-151-4/+4
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/jpeg2000dec: Check SIZ dimensions to be within the supported rangeMichael Niedermayer2015-11-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | Fixes potential integer overflows Fixes: 03e0abe721b1174856d41a1eb5d6a896/signal_sigabrt_7ffff6ae7cc9_3813_e71bf3541abed3ccba031cd5ba0269a4.avi This fix is choosen to be simple to backport, better solution for master is planed Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/jpeg2000dec: Check for duplicate SIZ markerMichael Niedermayer2015-11-141-0/+5
| | | | | | | | | | | | | | Fixes: 0231a17345734228011c6f35a64e4594/asan_heap-oob_1d92a72_3218_1213809a9e3affec77e4c191fdfdc0a9.mov Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/jpeg2000dec: Clip all tile coordinatesMichael Niedermayer2015-11-071-4/+4
| | | | | | | | | | | | | | | | Fixes out of array access Fixes: b877a6b788a25c70e8b1d014f8628549/asan_heap-oob_1da2c3f_2324_5a1b329b0b3c4bb6b1d775660ac56717.r3d Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/jpeg2000dec: Clear properties in jpeg2000_dec_cleanup() tooMichael Niedermayer2015-10-151-0/+1
| | | | | | | | | | | | Fixes: Ticket4878 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/jpeg2000dec: Check that step_x/y are valid before use in ↵Michael Niedermayer2015-10-111-0/+4
| | | | | | | | | | | | | | | | JPEG2000_PGOD_PCRL Fixes: CID1322305 and CID1322304 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '29b00f880faa404aa1d0d6820310c510c5996479'Hendrik Leppkes2015-09-161-96/+66
|\| | | | | | | | | | | | | * commit '29b00f880faa404aa1d0d6820310c510c5996479': jpeg2000: Templatize the frame writer Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * jpeg2000: Templatize the frame writerLuca Barbato2015-09-141-83/+58
| |
* | Merge commit '41bcc3d15204f290400ba02e4e8f87fc07bcc00e'Hendrik Leppkes2015-09-161-1/+3
|\| | | | | | | | | | | | | * commit '41bcc3d15204f290400ba02e4e8f87fc07bcc00e': jpeg2000: Split codeblock decoding from the main tile decoding Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * jpeg2000: Split codeblock decoding from the main tile decodingLuca Barbato2015-09-141-1/+3
| | | | | | | | That loop is completely stand-alone.
* | Merge commit '5788623d29c3e806a7879210986110aced758dc2'Hendrik Leppkes2015-09-121-9/+18
|\| | | | | | | | | | | | | * commit '5788623d29c3e806a7879210986110aced758dc2': jpeg2000: Split codeblock decoding from the main tile decoding Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * jpeg2000: Split codeblock decoding from the main tile decodingLuca Barbato2015-09-111-5/+14
| | | | | | | | That loop is completely stand-alone.
* | Merge commit 'db53a2306f62f05faa67e6f3c60ee55a9b8e4776'Hendrik Leppkes2015-09-121-0/+2
|\| | | | | | | | | | | | | * commit 'db53a2306f62f05faa67e6f3c60ee55a9b8e4776': jpeg2000: Do not warn about known and skippable markers Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * jpeg2000: Do not warn about known and skippable markersLuca Barbato2015-09-111-0/+4
| | | | | | | | Matches the openjpeg behaviour.
* | Replace all remaining occurances of step/depth_minus1 and offset_plus1Hendrik Leppkes2015-09-081-4/+4
| |
* | avcodec/jpeg2000dec: Initialize ret to avoid warning and make the code more ↵Michael Niedermayer2015-09-051-1/+2
| | | | | | | | | | | | | | | | robust "Fixes" CID1322361 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>