Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-09-25avcodec/mjpegdec: Check for unsupported bayer caseMichael Niedermayer
Fixes: out of array access Fixes: 51462/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-662559341582745 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit dd81cc22b3dd5bd6badf012b4fe4c19e062650f4) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-09-25avcodec/mjpegdec: bayer and rct are incompatibleMichael Niedermayer
Fixes: out of array read Fixes: 49434/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5208501080686592 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit a44f5a521227adc7be2f78b411f56da1a4d98704) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-08avcodec/mjpegdec: Check for bits left in mjpeg_decode_scan_progressive_ac()Michael Niedermayer
Fixes: Timeout Fixes: 36262/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEGLS_fuzzer-4969052454912000 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 909faca929cf30dcd439fa33479177e76fb5121d) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-04-08avcodec/mjpegdec: Fix leak in case ICC array allocations fail partiallyAndreas Rheinhardt
If only one of the two arrays used for the ICC profile could be successfully allocated, it might be overwritten and leak when the next ICC entry is encountered. Fix this by using a common struct, so that one has only one array to allocate. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> (cherry picked from commit a5b2f06b0c69221e375edd918a335c68b33d5667)
2021-04-03avcodec/mjpegdec: Check initializing Huffman tablesAndreas Rheinhardt
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> (cherry picked from commit d5ddfec6c3ce0ff743e3d67c42a1a59d3afe8e8c)
2021-04-03avcodec/mjpegdec: Fix leak in case of invalid external Huffman tablesAndreas Rheinhardt
When using external Huffman tables fails during init, the decoder reverts back to using the default Huffman tables; and when doing so, the current VLC tables leak because init_default_huffman_tables() doesn't free them before overwriting them. Sample: samples.ffmpeg.org/archive/all/avi+mjpeg+pcm_s16le++mjpeg-interlace.avi Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> (cherry picked from commit 3cc685b7bcc2bcc781b5632bf2e0af6ed941ae27)
2021-03-08mjpegdec: handle lowres with AVID croppingAnton Khirnov
2021-02-25Handle AVID MJPEG streams directly in the MJPEG decoder.Anton Khirnov
AVID streams - currently handled by the AVRN decoder - can be (depending on extradata contents) either MJPEG or raw video. To decode the MJPEG variant, the AVRN decoder currently instantiates a MJPEG decoder internally and forwards decoded frames to the caller (possibly after cropping them). This is suboptimal, because the AVRN decoder does not forward all the features of the internal MJPEG decoder, such as direct rendering. Handling such forwarding in a full and generic manner would be quite hard, so it is simpler to just handle those streams in the MJPEG decoder directly. The AVRN decoder, which now handles only the raw streams, can now be marked as supporting direct rendering. This also removes the last remaining internal use of the obsolete decoding API.
2021-02-23avcodec/g2meet, mjpegdec: Factor out common VLC initialization codeAndreas Rheinhardt
While just at it, remove the nb_codes parameter: It is redundant (the number of codes is implicitly contained in the array containing how many entries of a specific size there are) and for this reason it might even be wrong, so it is better to check what is actually used instead. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-22avcodec/mjpegdec: Cleanup ff_smvjpeg_decoder()Michael Niedermayer
Fixes: memleaks Fixes: 28533/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMVJPEG_fuzzer-6242529653686272 Fixes: 30594/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMVJPEG_fuzzer-6549216035995648 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-02-08mjpegdec: stop setting the QP tableAnton Khirnov
MJPEG does not have a single quantiser scale, so this does not fit into the intended API use. This removes the last use of the long-deprecated QP table API.
2021-01-01Mark some pointers as constAndreas Rheinhardt
Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-01-01lavc/mjpegdec: cosmetics, org->origAnton Khirnov
2020-12-13avcodec/mjpegdec: stop setting AVFrame->best_effort_timestampJames Almer
It's now set by the generic decode code. Signed-off-by: James Almer <jamrial@gmail.com>
2020-12-10smvjpegdec: merge into mjpegdecAnton Khirnov
SMVJPEG stores frames as slices of a big JPEG image. The decoder is implemented as a wrapper that instantiates a full internal MJPEG decoder, then forwards the decoded frames with offset data pointers. This is unnecessarily complex and fragile, not supporting useful decoder capabilities like direct rendering. Re-implement the decoder inside the MJPEG decoder, which is accomplished by returning each decoded frame multiple times, setting cropping information appropriately on each instance. One peculiar aspect of the previous design is that since - the smvjpeg decoder returns one frame per input packet - there are multiple frames in each packets (the aformentioned slices) the demuxer needs to return each packet multiple times. This is now also eliminated - the demuxer now returns each packet exactly once, with the duration set to the number of frames it decodes to. This also removes one of the last remaining internal uses of the old video decoding API.
2020-12-10mjpegdec: convert to receive_frame()Anton Khirnov
This will be useful in the following commit.
2020-12-08avcodec/mjpegdec: Simplify creating VLC tableAndreas Rheinhardt
ff_init_vlc_from_lengths() can be used to offload the computation of the codes; it also allows to omit the check whether the codes are already properly ordered (they are). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-04avcodec/mxpegdec: Fix memleaks upon init failureAndreas Rheinhardt
Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-04avcodec/mjpegdec: Fix memleak upon init failureAndreas Rheinhardt
This affected all decoders that used ff_mjpeg_decode_init() as init function; and it also affected decoders that open jpeg decoders via ff_codec_open2_recursive() as well as MxPEG. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-10-09avcodec/mjpegdec: Remove redundant initializationAndreas Rheinhardt
Now that the correct number of codes is used, it is no longer necessary to initialize the lengths of the codes at all any more as the length of the actually used codes is set later anyway. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-10-09avcodec/mjpegdec: Remove use_static from build_vlc()Andreas Rheinhardt
It is always zero; it referred to the INIT_VLC_USE_STATIC flag which has been removed in 595324e143b57a52e2329eb47b84395c70f93087. Reviewed-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-10-08avcodec/mjpegdec: Use correct number of codes when init default VLCsAndreas Rheinhardt
Commit bbc0d0c1fe2b7ecdc4367295594f084f85ad22f5 made the mjpeg decoder use default Huffman tables when none are given, yet when initializing the default Huffman tables, it did not use the correct number of entries of the arrays used to initialize the tables, but instead it used the biggest entry + 1 (as if it were a continuous array 0..biggest entry). This worked because the ff_init_vlc_sparse() (and its predecessors) always skipped entries with a length of zero and the length of the corresponding elements was always initialized to zero with only the sizes of the actually existing elements being set to a size > 0 lateron. Yet since commit 1249698e1b424cff8e77e6a83cfdbc9d11e01aa7 this is no longer so, as build_vlc() actually read the array containing the values itself. This implies that the wrong length now leads to a read beyond the end of the given array; this could lead to crashs (but usually doesn't); it is detectable by ASAN* and this commit fixes it. *: AddressSanitizer: global-buffer-overflow on address xy ... xy is located 0 bytes to the right of global variable 'avpriv_mjpeg_val_ac_luminance' Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-10-08avcodec/mjpegdec: Use correct number of codes for VLC tablesAndreas Rheinhardt
Commit 1249698e1b424cff8e77e6a83cfdbc9d11e01aa7 made ff_mjpeg_decode_dht() call build_vlc() with a wrong (too hight) number of codes. The reason it worked is that the lengths of the extraneous entries is initialized to zero and ff_init_vlc_sparse() ignores codes with a length of zero. But using a too high number of codes was nevertheless bad, because a) the assert in build_vlc() could have been triggered (namely if the real amount of codes is 256) and b) the loop in build_vlc() uses initialized data (leading to Valgrind errors [1]). Furthermore, the old code spend CPU cycles in said loop although the result won't be used anyway. [1]: http://fate.ffmpeg.org/report.cgi?slot=x86_64-archlinux-gcc-valgrind&time=20201008025137 Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-10-07avcodec/mjpegdec: improve decoding of DNG filesPaul B Mahol
That have unused symbols coded in DHT.
2020-07-05avcodec/mjpegdec: Limit bayer to single plane outputting formatMichael Niedermayer
This reduces the number of paths reachable with DNG and should improve security Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-04-26lavc: Rename hwaccel.h to hwconfig.hMark Thompson
This already applied to decoders as well as hwaccels, and adding encoder support was going to make the name even more inaccurate.
2019-12-31avcodec: Replace get_bits_long() by get_bits() where possibleMichael Niedermayer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-18avcodec/mjpegdec: Unify switch statementsAndreas Rheinhardt
This has been forgotten in d5a3a20d. Found via PVS-Studio (see ticket #8156). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-13avcodec/mjpegdec: Restore non bayer checks in ljpeg_decode_rgb_scan()Michael Niedermayer
Fixes: out of array write Fixes: 17088/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEGLS_fuzzer-5654877765632000 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-09-13avcodec/mjpegdec: Only allow 0x11110000 pix_fmt_id for bayer modeMichael Niedermayer
Fixes: NULL pointer dereference Fixes: assertion failure Fixes: 17003/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEG_fuzzer-5696929253556224 Fixes: 17039/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEG_fuzzer-5651008134316032 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-09-02lavc/mjpegdec: Skip unknown APPx marker on bayer imagesNick Renieris
Samples: - Embedded JPEG images in the DNG images here: https://www.photographyblog.com/previews/pentax_k1_photos Signed-off-by: Nick Renieris <velocityra@gmail.com>
2019-09-02lavc/mjpegdec: Enable decoding of single-component bayer imagesNick Renieris
Also, ensure no false positives when determining DNG bayer images, by setting them in tiff.c instead of relying on a heuristic. There's no way to determine this just from the JPEG data, so we have to pass this information from outside the MJPEG decoder. Signed-off-by: Nick Renieris <velocityra@gmail.com>
2019-09-02lavc/mjpegdec: Decode Huffman-coded lossless JPEGs embedded in DNGsNick Renieris
Main image data in DNGs is usually comprised of tiles, each of which is a Huffman-encoded lossless JPEG. Tested for ljpeg regressions with: `ffmpeg -f lavfi -i testsrc=d=1 -vcodec ljpeg test.avi` `ffmpeg test.avi out.avi` The modified code in ljpeg_decode_rgb_scan runs without issues. Signed-off-by: Nick Renieris <velocityra@gmail.com>
2019-07-01lavc/mjpegdec: make code alignedZhong Li
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-07-01lavc/mjpegdec: replace number with marker nameZhong Li
Make it easier to read. Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-06-12avcodec/mjpegdec: Check for non ls PAL8Michael Niedermayer
Fixes: Null-dereference READ in av_malloc Fixes: 15002/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_THP_fuzzer-5643474625363968 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-02-25avcodec/mjpegdec: Fix stereo3d memleakMichael Niedermayer
Fixes: 12937/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_THP_fuzzer-5714945346371584 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-12-19avcodec/mjpegdec: Fix indention of ljpeg_decode_yuv_scan()Michael Niedermayer
Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-12-19avcodec/mjpegdec: verify SOF len field validityMichael Niedermayer
Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-12-18lavc/mjpegdec: Interpret three-component Adobe transform 0 also as RGB.Carl Eugen Hoyos
While there, make a comparison with "RGB" more readable. Fixes ticket #7625.
2018-11-18mjpegdec: Fill raw huffman tables with default values tooMark Thompson
These may be used by hwaccel decoders when the standard tables are not otherwise available. At the same time, clean up that code into an array so it's a little less repetitive.
2018-11-05mjpeg: Use profile names in the encoder and decoderVittorio Giovara
2018-10-18lavc/mjpegdec: Support 2:3 subsampling.Carl Eugen Hoyos
Fixes ticket #7495.
2018-09-12avcodec/mjpegdec: simplify rgb index remapingMichael Niedermayer
2018-07-08avcodec/mjpegdec: Check for odd progressive RGBMichael Niedermayer
Fixes: out of array access Fixes: 9225/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEGLS_fuzzer-5684770334834688 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-06-23avcodec/mjpegdec: Check for end of bitstream in ljpeg_decode_rgb_scan()Michael Niedermayer
Fixes: Timeout Fixes: 8648/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEG_fuzzer-5108395525799936 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-06-06avcodec/mjpegdec: Fix integer overflow in ljpeg_decode_rgb_scan()Michael Niedermayer
Fixes: signed integer overflow: 32768 + 2147450880 cannot be represented in type 'int' Fixes: 7885/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_THP_fuzzer-5298834394578944 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-04-13avcodec/mjpegdec: Check input buffer size.Michael Niedermayer
Fixes: Timeout Fixes: 6381/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEGLS_fuzzer-5665032743419904 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-22avcodec/nvdec: Implement mjpeg nvdec hwaccelPhilip Langdale
2018-02-22vaapi: Add MJPEG decode hwaccelMark Thompson