summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* 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.
* sws: move initializing dither_error 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.
* sws: move the early return for zero-sized slices higher upAnton Khirnov2021-07-03
| | | | | Place it right after the input parameter validation. There is no point in performing any setup if the sws_scale() call won't do anything.
* sws: simplify setting sliceDirAnton Khirnov2021-07-03
|
* sws: merge handling frame start into a single blockAnton Khirnov2021-07-03
| | | | Also, return an error code on failure rather than 0.
* sws: make checking for the start of a new frame more explicitAnton Khirnov2021-07-03
|
* sws: reset sliceDir at the end of sws_scale()Anton Khirnov2021-07-03
| | | | | Makes it more clear that resetting it does not interact with the scaling code that it is currently intermixed with.
* sws: rename SwsContext.swscale to convert_unscaledAnton Khirnov2021-07-03
| | | | That function pointer is now used only for unscaled conversion.
* sws: separate the calls to scaled vs unscaled conversionAnton Khirnov2021-07-03
| | | | | | | | | | Call the scaler function directly rather than through a function pointer. Drop the now-unused return value from ff_getSwsFunc() and rename the function to reflect its new role. This will be useful in the following commits, where it will become important that the amount of output is different for scaled vs unscaled case.
* sws: do not reallocate scratch buffers for each sliceAnton Khirnov2021-07-03
|
* sws: group the parameters validity checks togetherAnton Khirnov2021-07-03
| | | | Also, fail with an error code rather than 0.
* sws: initialize {src,dst}Stride2 consistently with {src,dst}2Anton Khirnov2021-07-03
|
* sws: cosmeticsAnton Khirnov2021-07-03
| | | | Reindent after previous commit, rewrap long lines.
* sws: factor out cascaded scalingAnton Khirnov2021-07-03
|
* sws: cosmeticsAnton Khirnov2021-07-03
| | | | Reindent after previous commit, split long lines.
* sws: factor out gamma-correct scalingAnton Khirnov2021-07-03
|
* sws: return an error code on invalid parameters to sws_scale()Anton Khirnov2021-07-03
|
* sws: reindent after previous commitAnton Khirnov2021-07-03
|
* sws: factor out updating the paletteAnton Khirnov2021-07-03
|
* sws: remove unnecessary bracesAnton Khirnov2021-07-03
| | | | | There used to be more code inside them, but it was removed in 6de58b49032a206985602effec91e5e46c886ea2.