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-30avcodec/tiff: Remove commented-out codeAndreas Rheinhardt
Also remove a variable that is only used in this commented-out codeblock. This fixes a -Wunused-variable warning. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-25avcodec/tiff: support multiple black levelsPaul B Mahol
2022-09-25avcodec/tiff: implement FF_CODEC_CAP_SKIP_FRAME_FILL_PARAMPaul B Mahol
2022-09-25avcodec/tiff: improve color handling in DNGPaul B Mahol
2022-09-25avcodec/tiff: add packed/planar 32bit float supportPaul B Mahol
2022-09-23avcodec/tiff: improve lut handling for DNGPaul B Mahol
2022-09-16avcodec/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>
2022-09-03avcodec/codec_internal: Add macro to set AVCodec.long_nameAndreas Rheinhardt
It reduces typing: Before this patch, there were 105 codecs whose long_name-definition exceeded the 80 char line length limit. Now there are only nine of them. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-01lavc/tiff: Support multi-component files without RowsPerStrip tag.Carl Eugen Hoyos
Fixes ticket #9514.
2022-08-27avcodec/internal: Move ff_set_dimensions() to decode.hAndreas Rheinhardt
Decoder-only, as the dimensions are set by the user when encoding. Also fixup the other headers a bit while removing unnecessary internal.h inclusions. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-30avcodec/codec_internal: add cap for ICC profile supportNiklas Haas
Codecs that can read/write ICC profiles deserve a special capability so the common logic in encode.c/decode.c can decide whether or not there needs to be any special handling for ICC profiles. The motivation here is to be able to use it to decide whether or not an ICC profile needs to be generated in the encode path, but it might as well get added to decoders as well for purely informative reasons. It's not entirely clear to me whether the "thp" and "smvjpeg" variants of "mjpeg" should have this capability set or not, given that the code technically supports it but I somehow doubt these files may contain them. In either case, this cap is purely informative for decoders so it doesn't matter too much either way. It's also not entirely clear whether the "amv" encoder should signal ICC profile support, but again erring on the side of caution, we probably *shouldn't* be generating (and encoding!) ICC profiles for this type of media file. Signed-off-by: Niklas Haas <git@haasn.dev>
2022-07-22avcodec/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>
2022-07-18avcodec: Make init-threadsafety the defaultAndreas Rheinhardt
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>
2022-07-12avcodec/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>
2022-04-05avcodec/codec_internal: Use union for FFCodec decode/encode callbacksAndreas Rheinhardt
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>
2022-04-05avcodec/codec_internal: Make FFCodec.decode use AVFrame*Andreas Rheinhardt
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>
2022-03-22avcodec/mathops: Move bitswap_32() to its only userAndreas Rheinhardt
Effectively reverts eaff1aa09e90e2711207c9463db8bf8e8dec8178 given that bitswap_32 is no longer used outside of bitstream.c since 03008c2811ec26cf338780a89b6b2b849b399e3c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-21avcodec/codec_internal: Add FFCodec, hide internal part of AVCodecAndreas Rheinhardt
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>
2022-03-21avcodec/internal: Move FF_CODEC_CAP_* to a new header codec_internal.hAndreas Rheinhardt
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>
2022-03-03avcodec/tiff: do not abort on zero denominatorPaul B Mahol
Fixes decoding valid DNG file.
2022-02-09avcodec/thread: Don't use ThreadFrame when unnecessaryAndreas Rheinhardt
The majority of frame-threaded decoders (mainly the intra-only) need exactly one part of ThreadFrame: The AVFrame. They don't need the owners nor the progress, yet they had to use it because ff_thread_(get|release)_buffer() requires it. This commit changes this and makes these functions work with ordinary AVFrames; the decoders that need the extra fields for progress use ff_thread_(get|release)_ext_buffer() which work exactly as ff_thread_(get|release)_buffer() used to do. This also avoids some unnecessary allocations of progress AVBuffers, namely for H.264 and HEVC film grain frames: These frames are not used for synchronization and therefore don't need a ThreadFrame. Also move the ThreadFrame structure as well as ff_thread_ref_frame() to threadframe.h, the header for frame-threaded decoders with inter-frame dependencies. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-31avcodec/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>
2021-12-23avcodec/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>
2021-12-23avcodec/tiff: Pass max_pixels to mjpeg contextMichael Niedermayer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-20Replace all occurences of av_mallocz_array() by av_calloc()Andreas Rheinhardt
They do the same. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-27avcodec: Constify AVCodecsAndreas Rheinhardt
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>
2021-04-02avcodec/tiff: Don't use separate temporary buffer for faxAndreas Rheinhardt
Also don't unnecessarily copy the input data around if it needn't be reversed; and remove a redundant memset -- av_fast_padded_malloc() already does this for us. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-03-31avcodec/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>
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>