summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* avformat/mxfdec: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-08
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mpsubdec: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-08
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mpl2dec: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-08
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mpeg: Simplify cleanup after reading vobsub header failsAndreas Rheinhardt2021-07-08
| | | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Furthermore, also remove an unnecessary check for NULL before avformat_close_input(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mov: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | | | | | | | | | | | | | | | By default, a demuxer's read_close function is not called automatically if an error happens when reading the header; instead it is up to the demuxer to clean up after itself in this case. The mov demuxer did this by calling its read_close function when it encountered some errors when reading the header. This commit changes this by setting the FF_FMT_INIT_CLEANUP flag so that mov_read_close() is automatically called when an error happens when reading the header. (Btw: mov_read_close() is not idempotent: Calling it twice is dangerouos, because MOVContext.frag_index.item will be av_freep'ed, yet MOVContext.frag_index.nb_items won't be reset. So the calls to mov_read_close() have to be removed before the switch to freeing generically.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mlvdec: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/microdvddec: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mccdec: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskadec: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/lrcdec: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/libopenmpt: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/libgme: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/jvdec: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/jacosubdec: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/icodec: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/hls: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/dashdec: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/concatdec: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | | | | | by setting the FF_FMT_INIT_CLEANUP flag. (Btw: concat_read_close() is not idempotent (it frees cat->files, but doesn't reset cat->nb_files), so this demuxer was incompatible with simply calling read_close generically upon read_header failure.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/brstm: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/av1dec: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/assdec: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/aqtitledec: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/ape: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/avidec: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/aaxdec: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/aadec: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/4xm: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: Redo cleanup of demuxers upon read_header() failureAndreas Rheinhardt2021-07-07
| | | | | | | | | | | | | | | | | | | | If reading the header fails, the demuxer's read_close() function (if existing) is not called automatically; instead several demuxers call it via "goto fail" in read_header(). This commit intends to change this by adding an internal flag for demuxers that can be used to set on a per-AVInputFormat basis whether read_close() should be called generically after an error during read_header(). The flag controlling this behaviour needs to be added because it might be unsafe to call read_close() generally (e.g. this might lead to read_close() being called twice and this might e.g. lead to double-frees if av_free() is used instead of av_freep(); or a size field has not been reset after freeing the elements (see the mov demuxer for an example of this)). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: Add internal flags for AV(In|Out)putFormatAndreas Rheinhardt2021-07-07
| | | | | | | | | | | | | | | | Both AVInputFormat and AVOutputFormat currently lack an equivalent to AVCodec's caps_internal. E.g. if reading a header fails, each demuxer is currently required to clean up manually, which often means to just call the demuxer's read_close function. This could (and will) be done generically via an equivalent of FF_CODEC_CAP_INIT_CLEANUP. Because of the unholy ABI-relationship between libavdevice and libavformat adding such a flag is only possible when the ABI is open (despite the flag not being part of the public API), such as now. Therefore such a flag is also added to AVOutputFormat, despite there being no immediate use for it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/f_metadata: do not return the frame early if there is no metadataMarton Balint2021-07-06
| | | | | | | | | The early return caused isses for the "add" mode (got fixed in c95dfe5cce98cde3e7fb14fbd04b3897f3927cec) and the "select" mode needs a similar fix. It is probably better to fully remove the check, since all modes work correctly with NULL metadata. Signed-off-by: Marton Balint <cus@passwd.hu>
* tools/target_dec_fuzzer: move maximum variables into functionMichael Niedermayer2021-07-06
| | | | | | | | | | This fixes an issue when multiple cases are fuzzed in a single run and the limits are adjusted by more than the iteration limit. In that case the adjusted limit leaked back into the global limit causing the fuzzer to become ineffective after several iterations, MSS2 was affected by this for example. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/matroskadec: Fix handling of huge default durationsMichael Niedermayer2021-07-06
| | | | | | | | Fixes: negation of -9223372036854775808 cannot be represented in type 'int64_t' (aka 'long'); cast to an unsigned type to negate this value to itself Fixes: 33997/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-6752039691485184 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavformat/rtpdec_rfc4175: Check for zero pgroup before modKyle Schwarz2021-07-06
| | | | Signed-off-by: Kyle Schwarz <zeranoe@gmail.com>
* avfilter/fps: remove unconventional acronymsGyan Doshi2021-07-06
| | | | | | | | | In dd770883e9, support for expressions was added. Among the constants added were labels of qnstc, qpal, sntsc & spal. These were added in ba2a8cb40b to represent parameter permutations where only the resolution is different. They don't have any usage currency and don't represent any industry standards or convention in terms of framerate.
* avfilter/dnn_filter_common: Use const where appropriateLimin Wang2021-07-06
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/rtsp: Include rtcp in port range checkAndriy Gelman2021-07-05
| | | | | | | Currently it is only checked that the rtp port does not exceed rtp_port_max. Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
* avformat/rtsp: Reindent after previous commitAndriy Gelman2021-07-05
| | | | | Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
* avformat/rtsp: Set port_off to zero for low min/max port rangeAndriy Gelman2021-07-05
| | | | | | | | | Fixes: $ ffmpeg -min_port 32000 -max_port 32001 -i rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov -f null - [1] 303871 floating point exception (core dumped) Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
* avcodec/mjpegdec: Try to continue decoding on zero quant matrix valueAndriy Gelman2021-07-05
| | | | | | | | | | | A zero value in the quantization matrix is invalid but in practice will just set the transform coefficient to zero after inverse quantization. Try to continue decoding if the AV_EF_EXPLODE flag is not set. Fixes ticket #9287. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
* avformat/rtsp: Fix timeout optionAndriy Gelman2021-07-05
| | | | | | | | | | | | | | | | | | | | | | | 92c40ef882be115e72d2aa02f9032b7ce88f8537 added a listen_timeout option for sdp. This allowed a user to set variable timeout which was originally hard coded to 10 seconds. The commit used the initial_timeout variable to store the value. But this variable is shared with rtsp where it's used to infer a "listen" mode. Thus, the timeout value could not be set in rtsp, and the default value (initial_timeout = -1) would give 100ms timeout. This was attempted to be fixed in c8101aabee654f6d147a4d89f77fa73e18908610, which changed the meaning of initial_timeout = -1 to be an infinite timeout. However, it did not address the issue that the timeout could still not be set. Being able to set the timeout is useful because it allows to automatically reconfigure from a udp to tcp connection in the lower transport. In this commit this is fixed by using the stimeout variable to store the timeout value. Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
* avcodec/setts_bsf: add a NOPTS constantJames Almer2021-07-04
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/setts_bsf: actually store the current packet's timestamps to be ↵James Almer2021-07-04
| | | | | | | | | | usable by the next Before this change, the PREV_OUTPTS and PREV_OUTDTS constants always evaluated to AV_NOPTS_VALUE. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* lavfi/dnn_backend_openvino.c: Fix Memory Leak in execute_model_ovShubhanshu Saxena2021-07-04
| | | | | | | | In cases where the execution inside the function execute_model_ov fails, push the RequestItem back to the request_queue before returning the error. In case pushing back fails, release the allocated memory. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* avcodec/bsf: switch to av_get_token to parse bsf list stringGyan Doshi2021-07-04
| | | | | | | | | | The recently added setts bsf makes use of the eval API whose expressions can contain commas. The existing parsing in av_bsf_list_parse_str() uses av_strtok to naively split the string at commas, thus preventing the use of setts filter with expressions containing commas. av_get_token can work with escaped commas, allowing full use of setts.
* avcodec/lpc: check for zero err in normalization in compute_lpc_coefs()Michael Niedermayer2021-07-03
| | | | | | | Fixes: floating point division by 0 Fixes: Ticket8213 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/j2kenc: Check for av_strtok() failureMichael Niedermayer2021-07-03
| | | | | | Fixes: CID1466601 Dereference null return value Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/ftp: Check for av_strtok() failureMichael Niedermayer2021-07-03
| | | | | | Fixes: CID1396258 Dereference null return value Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* tools/cws2fws: Check read() for failureMichael Niedermayer2021-07-03
| | | | | | Fixes: CID1452579 Argument cannot be negative Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* tools/target_dec_fuzzer: Adjust threshold for theoraMichael Niedermayer2021-07-03
| | | | | | | | Fixes: Timeout Fixes: 33916/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_THEORA_fuzzer-4620863119949824 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* sws: move updating the palette higher upAnton Khirnov2021-07-03
| | | | | It does not interact in any way with the code setting up the image pointers/strides, so it should not be intermixed with it.