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/tiff: Fix loop detectionMichael Niedermayer
Fixes regression with tickets/4364/L1004220.DNG Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 43a4854510a3d596e114d899177a5b3b323ca9fb) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-09-25avcodec/tiff: Check tile_length and tile_widthMichael Niedermayer
Fixes: Division by 0 Fixes: 49235/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5495613847896064 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 76112c2b4167bb3c40503b3334c8b38fd707a8d5) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-09-25avcodec/tiff: Check pixel format types for dngMichael Niedermayer
Fixes: out of array access Fixes: 48271/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-6149705769287680 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 75f3d1b82261f31c6bbcee8046cec6792194355a) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-04-06avcodec/tiff: Remove messing with jpeg contextMichael Niedermayer
The whole concept is just not correct, also as it seems not to be needed at all, all dng files i have decode without this. Fixes: various crashes Fixes: 42937/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4625073334517760 Fixes: 42938/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4643368217477120 Fixes: 42939/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4925325908246528 Fixes: 42940/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4925378806808576 Fixes: 42941/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-6202009265504256 Fixes: 42944/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-6076860998483968 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 afdbc940c6011b64c1856f88d2b0609369f87406) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-04-06avcodec/tiff: Use ff_set_dimensions() for setting up mjpeg context dimensionsMichael Niedermayer
sets coded_width / coded_height too to keep them consistent with width / height Fixes: OOM Fixes: 42263/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5653333619113984 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 cfa1f0e214d07f0fdc027f2ec760eb9fd3fac85e) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-04-06avcodec/tiff: Pass max_pixels to mjpeg contextMichael Niedermayer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit d6c16f42ccebca917bb9861c619abcf71ab25762) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-04-08avcodec/tiff: Avoid forward declarationsAndreas Rheinhardt
In this case it also fixes a potential for compilation failures: Not all compilers can handle the case in which a function with a forward declaration declared with an attribute to always inline it is called before the function body appears. E.g. GCC 4.2.1 on OS X 10.6 doesn't like it. Reviewed-by: Pavel Koshevoy <pkoshevoy@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> (cherry picked from commit e5d6af7b35d97f5c1252ecf8bd61f3295909fb6c)
2021-03-17avcodec/tiff: use av_packet_alloc() to allocate AVPacketsJames Almer
Signed-off-by: James Almer <jamrial@gmail.com>
2021-03-09avcodec: Constify some AVPacketsAndreas Rheinhardt
Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-23avcodec/tiff_data: Move data to its only userAndreas Rheinhardt
tiff.c is the only user of the data from tiff_data.c (the dependency of the tiff encoder of it is spurious). Therefore this commit moves all the data from tiff_data.c to tiff_data.h (which is only included by tiff.c) and makes the objects declared therein static. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-28avcodec/tiff: Disallow striped and tiled tiffs except for DNGMichael Niedermayer
strips + tiles is not allowed in TIFF DNG uses a separate codepath Regression since da5b3d002862d1e105002a6dc1567e6551860896. Fixes: NULL pointer dereference Fixes: poc1 Fixes: Ticket8960 Found-by: 1vanChen of NSFOCUS Security Team Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-12-04avcodec/tiff: Make decoder init-threadsafeAndreas Rheinhardt
The only thing that stands in the way of adding the FF_CODEC_CAP_INIT_THREADSAFE flag to the TIFF decoder is its usage of ff_codec_open2_recursive(): This function requires its caller to hold the lock for the mutex that guards initialization of AVCodecContexts whose codecs have a non-threadsafe init function and only callers whose codec does not have the FF_CODEC_CAP_INIT_THREADSAFE flag set hold said lock (the others don't need to care about said lock). But one can set the flag if one switches to avcodec_open2() at the same time. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-10-11lavc, lavf: Remove newlines from calls to avpriv_request_sample().Carl Eugen Hoyos
2020-10-07avcodec/tiff: do not abort decoding if strips are availablePaul B Mahol
Even if such files are invalid, they can be decoded just fine. Also stored tiles may have bigger dimensions than displayed ones, so do not abort decoding in such cases.
2020-09-19avcodec/tiff: Fix default white levelMichael Niedermayer
According to the spec bits per sample should be used Fix invalid shift with bpp=32 Fixes: shift exponent 32 is too large for 32-bit type 'unsigned int' Fixes: 23507/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4815432665268224 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-09-06tiff: remove tiff type check for ICC profilesLynne
Although the ICC specifications say to check for this, libtiff doesn't and neither does any other TIFF implementation, and the TIFF specs say that Photoshop has a different way to encapsulate ICC profiles, and are asking for advice on how to deal with it. So basically, photoshop puts a different type than what's specified, no other implementation checks for this, we do because we tried to follow the specs although its harmless to not, and ran into this bug because we didn't know about it.
2020-08-26avcodec/tiff: Check jpeg context against jpeg frame parametersMichael Niedermayer
Fixes: out of array access Fixes: 24825/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-6326925027704832 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-08-26avcodec/tiff: Restrict tag order based on specificationMichael Niedermayer
"The entries in an IFD must be sorted in ascending order by Tag. Note that this is not the order in which the fields are described in this document." This way various dimensions, sample and bit sizes cannot be changed at arbitrary times which reduces the potential for bugs. The tag reading code also on various places assumes that numerically previous tags have already been parsed, so this needs to be enforced one way or another. If this commit causes problems with real world files which are not easy to fix then some other form of checks are needed to ensure the various dependencies in the tag reading are not violated. Fixes: out of array access Fixes: 24825/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-6326925027704832 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-08-26avcodec/tiff: Avoid abort with DNG RAW TIFF with YA8Michael Niedermayer
Fixes: Assertion failure Fixes: 24707/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5179910197608448 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-08-26avcodec/tiff: Check the linearization table sizeMichael Niedermayer
Fixes: out of array access Fixes: 24604/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4843529818603520 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-08-07avcodec/tiff: Check bpp/bppcount for 0Michael Niedermayer
Fixes: division by zero Fixes: 24253/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-6250318007107584 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-10avcodec/tiff: Check input space in dng_decode_jpeg()Michael Niedermayer
Fixes: out of array read Fixes: 24034/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5111884337119232 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-05avcodec/tiff: Check frame parameters before blit for DNGMichael Niedermayer
Fixes: out of array access Fixes: 23888/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-6021365974171648.fuzz Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-02avcodec/tiff: Do not overrun the array ends in dng_blit()Michael Niedermayer
Fixes: out of array access Fixes: 23589/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5110559589793792.fuzz Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-06-15avcodec/tiff: Check stride for dngMichael Niedermayer
Fixes: assertion failure Fixes: 23422/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5746026064642048 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-05-21avcodec/tiff: Check for Tiled and Stripped TIFFsMichael Niedermayer
TIFF 6 spec: "Do not use both strip-oriented and tile-oriented fields in the same TIFF file." Fixes: null pointer use, crash Fixes: crash-762680f9d1b27f9b9085e12887ad44893fb2b020 Found-by: Shiziru <lunasl@protonmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-05-08avcodec/tiff: remove the unnecessary type conversionLimin Wang
Reviewed-by: Carl Eugen Hoyos <ceffmpeg@gmail.com> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-04-30avcodec/tiff: assert that raw tiff dng blit does not write over the end of a ↵Michael Niedermayer
line Found-by: 黄宁 <tsukimurarin@163.com> Reviewed-by: Nick Renieris <velocityra@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-04-30avcodec/tiff: Check for planar DNG imagesMichael Niedermayer
The DNG code hardcodes plane 0 at some places, so its better to disallow cases that have more planes. Fixes: eg_crash Found-by: 黄宁 <tsukimurarin@163.com> Reviewed-by: Nick Renieris <velocityra@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-04-30avcodec/tiff: Replace width overriding for bayer by assertMichael Niedermayer
This is less confusing Reviewed-by: Nick Renieris <velocityra@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-04-30avcodec/tiff: Some checks on bpp for DNGMichael Niedermayer
dng spec 1.5.0.0 "BitsPerSample Supported values are from 8 to 32 bits/sample. The depth must be the same for each sample if SamplesPerPixel is not equal to 1." Fixes: eg_crash Found-by: 黄宁 <tsukimurarin@163.com> Reviewed-by: Nick Renieris <velocityra@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-04-10pthread_frame: merge the functionality for normal decoder init and ↵Anton Khirnov
init_thread_copy The current design, where - proper init is called for the first per-thread context - first thread's private data is copied into private data for all the other threads - a "fixup" function is called for all the other threads to e.g. allocate dynamically allocated data is very fragile and hard to follow, so it is abandoned. Instead, the same init function is used to init each per-thread context. Where necessary, AVCodecInternal.is_copy can be used to differentiate between the first thread and the other ones (e.g. for decoding the extradata just once).
2020-01-14tiffdec: support embedded ICC profilesLynne
2019-10-29avcodec/tiff: check the black level denominatorJames Almer
Fixes ticket #8327. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
2019-10-03avcodec/tiff: Set FF_CODEC_CAP_INIT_CLEANUPMichael Niedermayer
Fixes: memleaks Fixes: 17813/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5145600206569472 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-26Revert "lavc/tiff: correct the default value of YCbCrSubsampling to 2x2"Carl Eugen Hoyos
This reverts commit eb5d0f18ff609ba2280cea4e2c6286d216c8756b. Together with 89f464e9, it breaks decoding of tiff files like fate-suite/exif/image_small.tiff
2019-09-25lavc/tiff: correct the default value of YCbCrSubsampling to 2x2Pavel Skakov
2019-09-02avcodec/tiff: rewrite lut handlingPaul B Mahol
Remove endianess hack.
2019-09-02avcodec/tiff: set color_trc, remove sRGB conversionPaul B Mahol
2019-09-02lavc/tiff: Enable decoding of LinearRaw imagesNick Renieris
"LinearRaw" is a value that the PhotometricInterpretation tag can be set to on DNG images that contain color information for all channels instead of being bayer-encoded ("CFA" value). The DNG decoder is complete enough that we can enable this now. Sample: - http://www.rawsamples.ch/raws/nikon/SCANNER_NIKON_LS5000.DNG Signed-off-by: Nick Renieris <velocityra@gmail.com>
2019-09-02lavc/tiff: Default-initialize WhiteLevel DNG tag valueNick Renieris
Initialized to `(2 ^ BitsPerSample) - 1` as per the DNG Specification. Also make sure that `BlackLevel < WhiteLevel`. This fixes decoding for "X7 CinemaDNG" samples here: - https://www.dji.com/gr/zenmuse-x7/info#downloads Signed-off-by: Nick Renieris <velocityra@gmail.com>
2019-09-02lavc/tiff: Support DNGs with striped (non-tiled) JPEGs imagesNick Renieris
DNG samples here can now be decoded: - https://www.photographyblog.com/previews/pentax_k1_photos Signed-off-by: Nick Renieris <velocityra@gmail.com>
2019-09-02lavc/tiff: Decode 10-bit and 14-bit DNG imagesNick Renieris
10-bit sample: http://www.rawsamples.ch/raws/phones/RAW_ONEPLUS_ONE-A0001.DNG 14-bit sample: https://drive.google.com/open?id=0B4JyRT3Lth5HVndyOTVOdWktM3J4TFEydTk1MnY3RWlpSzVB Signed-off-by: Nick Renieris <velocityra@gmail.com>
2019-09-02lavc/tiff: Support decoding of DNGs with single-component JPEGsNick Renieris
This enables decoding of DNG images generated by the 'DJI Zenmuse X7' digital camera Samples: https://www.dji.com/gr/zenmuse-x7/info#downloads 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/tiff: Force DNG pixel data endianness on an edge caseNick Renieris
This fixes "X7 RAW" and "X7 CinemaDNG" samples here: - https://www.dji.com/gr/zenmuse-x7/info#downloads Signed-off-by: Nick Renieris <velocityra@gmail.com>
2019-09-02lavc/tiff: Don't apply strips-related logic to tiled imagesNick Renieris
Signed-off-by: Nick Renieris <velocityra@gmail.com>
2019-09-02lavc/tiff: Fix edge case with full-length/width tilesNick Renieris
When the height is equal to the tile length (full-height tile) after `height % tile_length` is applied with the current code, it results in the operating tile_length to be 0. This commit makes this leftover logic only applies if it's necessary. Signed-off-by: Nick Renieris <velocityra@gmail.com>
2019-09-02lavc/tiff: Apply color scaling to uncompressed DNGsNick Renieris
Signed-off-by: Nick Renieris <velocityra@gmail.com>
2019-09-02lavc/tiff: Convert DNGs to sRGB color spaceNick Renieris
Signed-off-by: Nick Renieris <velocityra@gmail.com>