summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* lavc: replace internal use of AV_CODEC_CAP_AUTO_THREADS with an internal capAnton Khirnov2021-03-16
| | | | | | | | | | | | | | | | AV_CODEC_CAP_AUTO_THREADS was originally added in b4d44a45f9a to mark codecs that spawn threads internally and are able to select an optimal threads count by themselves (all such codecs are wrappers around external libraries). It is used by lavc generic code to check whether it should handle thread_count=0 itself or pass the zero directly to the codec implementation. Within this meaning, it is clearly supposed to be an internal cap rather than a public one, since from the viewpoint of a libavcodec user, lavc ALWAYS handles thread_count=0. Whether it happens in the generic code or within the codec internals is not a meaningful difference for the caller. External aspects of this flag will be dealt with in the following commit.
* doc/encoders: Remove text about single bit-depth libx264 supportTobias Rapp2021-03-16
| | | | | | | | In the meanwhile libx264 allows to be configured for including both 8/10 bit support within a single library. The new libx264 interface was enabled in 2f96190732d15510ba29471fa45d66841c0c3df1. Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
* avformat/matroskadec: Check for EOF in resync loopMichael Niedermayer2021-03-15
| | | | | | | | | Fixes: Timeout (too long -> instantly) Fixes: 29136/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-4586141227548672 Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/utils: Use more bits for intermediate for AV_CODEC_ID_ADPCM_MSMichael Niedermayer2021-03-15
| | | | | | | | Fixes: signed integer overflow: 1172577312 * 2 cannot be represented in type 'int' Fixes: 29924/clusterfuzz-testcase-minimized-ffmpeg_dem_BOA_fuzzer-4882912874594304 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/ipmovie: Free packets allocated in header readingMichael Niedermayer2021-03-15
| | | | | | | | Fixes: memleaks Fixes: 29905/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5679700745781248 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavformat/hls: Reset options after open_url_keepalive() failsEd Martin2021-03-15
| | | | | | | | | | | | | | open_url_keepalive() unsets the options when it uses them, this includes the offsets for the Range: header. When using the HLS tag #EXT-X-BYTERANGE along with multiple files, the range options must be preserved after open_url_keepalive() returns EOF so that the new file can be opened. Failure to do this results in ignoring the #EXT-X-BYTERANGE tag and reading the wrong bytes of the file. To fix it, reset the options before calling io_open() following open_url_keepalive() reaching EOF Reviewed-by: Steven Liu <liuqi05@kuaishou.com>
* avcodec/decode: Remove outdated commentAndreas Rheinhardt2021-03-15
| | | | | | | Removing it was forgotten in 417d473bde220a1f267bc694835c129a5adc4309. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avutil/avstring: Check for memory allocation error in av_escapeAndreas Rheinhardt2021-03-15
| | | | | | | | av_bprint_finalize() can still fail even when it has been checked that the AVBPrint is currently complete: Namely if the string was so short that it fit into the AVBPrint's internal buffer. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avutil/avstring: Limit string length in av_escape to range of intAndreas Rheinhardt2021-03-15
| | | | | | Otherwise the caller can't distinguish the return value from an error. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/h264_cavlc: Reindent after the previous commitAndreas Rheinhardt2021-03-15
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/h264_cavlc: Remove redundant checkAndreas Rheinhardt2021-03-15
| | | | | | | | | | The only caller to ff_h264_decode_init_vlc() already uses ff_thread_once() for the call; ergo the check via a simple int with static storage duration in ff_h264_decode_init_vlc() is redundant. And if it were not redundant, it would be a potential for data races. So remove it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* doc/APIchanges: Fill in some missing informationMichael Niedermayer2021-03-14
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpegls: Check A[Q] for overflow in ff_jpegls_update_state_regular()Michael Niedermayer2021-03-14
| | | | | | | | Fixes: Timeout Fixes: 30912/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEG_fuzzer-5556235476795392 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/voc_packet: prevent remaining size from becoming negative in ↵Michael Niedermayer2021-03-14
| | | | | | | | | | ff_voc_get_packet() Fixes: memleak Fixes: 30909/clusterfuzz-testcase-minimized-ffmpeg_dem_AVS_fuzzer-4886284057313280 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/timecode: Avoid fps overflowMichael Niedermayer2021-03-14
| | | | | | | | Fixes: Integer overflow and division by 0 Fixes: poc-202102-div.mov Found-by: 1vanChen of NSFOCUS Security Team Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mvi: Check audio size for more overflowsMichael Niedermayer2021-03-14
| | | | | | | | Fixes: left shift of negative value -352256000 Fixes: 30837/clusterfuzz-testcase-minimized-ffmpeg_dem_MVI_fuzzer-5755626262888448 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/samidec: Deallocate hdr_bufMichael Niedermayer2021-03-14
| | | | | | | | Fixes: memleak Fixes: 30841/clusterfuzz-testcase-minimized-ffmpeg_dem_SAMI_fuzzer-4521799196999680 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/cfhd: Fix negative shift in cfhd_decode()Michael Niedermayer2021-03-14
| | | | | | | | Fixes: left shift of negative value -1 Fixes: 30714/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_fuzzer-4867823371419648 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avdevice/xcbgrab: Add option for grabbing a windowsgerwk2021-03-14
| | | | | | | | The option allows to select a specific window instead of the whole screen. Reviewed-by: Andriy Gelman <andriy.gelman@gmail.com> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
* avcodec: add a mention about get_encode_buffer in the old encode API doxyJames Almer2021-03-14
| | | | | | | | Direct users to the callback that should be used to keep supporting user provided buffers with the new encode API. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/vf_xfade: drop unused frames from inactive inputsPaul B Mahol2021-03-14
|
* doc/filters: note default for zoompan's durationGyan Doshi2021-03-14
|
* avcodec/flacdec: Avoid undefined shift in error caseMichael Niedermayer2021-03-13
| | | | | | | | Fixes: flac_1040988 Reported-by: Thomas Guilbert <tguilbert@google.com> Reviewed-by: Thomas Guilbert <tguilbert@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/cinedec: Fix index_entries size checkMichael Niedermayer2021-03-13
| | | | | | | | Fixes: out of array access Fixes: 29868/clusterfuzz-testcase-minimized-ffmpeg_dem_CINE_fuzzer-5692001957445632 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/h264_metadata_bsf: Check nb_units before accessing the first in ↵Michael Niedermayer2021-03-13
| | | | | | | | | | h264_metadata_update_fragment() Fixes: null pointer dereference Fixes: 29835/clusterfuzz-testcase-minimized-ffmpeg_BSF_H264_METADATA_fuzzer-4712125383704576 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/aaxdec: Check that segments table has been initializedMichael Niedermayer2021-03-13
| | | | | | | | Fixes: Timeout Fixes: 29766/clusterfuzz-testcase-minimized-ffmpeg_dem_AAX_fuzzer-5635887566290944 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ffv1dec: Check if trailer is availableMichael Niedermayer2021-03-13
| | | | | | | | Fixes: out of array read Fixes: 29750/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFV1_fuzzer-4808377272238080.fuzz Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/exr: Check col/line for integer overflowMichael Niedermayer2021-03-13
| | | | | | | | Fixes: signed integer overflow: -2272 + -2147483360 cannot be represented in type 'int' Fixes: 30009/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5005660322398208 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat: add Changelog entry for librist and bump minorMarton Balint2021-03-13
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/librist: clarify and limit buffer_sizeMarton Balint2021-03-13
| | | | | | As suggested by librist developers. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/librist: increase default loglevelMarton Balint2021-03-13
| | | | | | | | | Also remove AV_LOG_SIMULATE from the list as it is not used directly, and do not use panic level on unknown loglevel, but make them warn. Also fix mapping of NOTICE/INFO/VERBOSE and add documentation about when the option should actually be used. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/librist: simplify secret strlcpyMarton Balint2021-03-13
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/librist: make packet size adjustable for writing, fix it for readingMarton Balint2021-03-13
| | | | | | | | Maximum packet size is 10000 (RIST_MAX_PACKET_SIZE, which is unfortunately private) minus the RIST protocol overhead which is 28 bytes for the unencrypted case, 36 for the encrypted case. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/librist: rework librist_readMarton Balint2021-03-13
| | | | | | | Queue tracking makes no difference so remove it, return EAGAIN of no data is available and rist data block needs to be freed even for zero sized packets. Signed-off-by: Marton Balint <cus@passwd.hu>
* libavformat: add librist protocolPaul B Mahol2021-03-13
| | | | | | This work is sponsored by Open Broadcast Systems. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* libavutil/timer: Fix clang reserved-user-defined-literalChristopher Degawa2021-03-13
| | | | | | | | clang errors when compiling with C++11 about needing spaces between literal and identifier Signed-off-by: Christopher Degawa <ccom@randomderp.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avdevice/pulse_audio_dec: do not read undersized framesMarton Balint2021-03-12
| | | | | | | | | | | Keep on reading fragments until we got fragment_size amount of data, otherwise we might get frames with 1-2 samples only if pa_stream_peek is called slightly less frequently than sample rate. Note that fragments might contain a lot less data than fragment_size, so reading multiple fragments to get fragment_size amount of data is intentional. Signed-off-by: Marton Balint <cus@passwd.hu>
* avdevice/pulse_audio_dec: only set adjust latency flag if fragment_size is ↵Marton Balint2021-03-12
| | | | | | | | not set Otherwise fragment_size is ignored. Signed-off-by: Marton Balint <cus@passwd.hu>
* avdevice/pulse_audio_dec: query actual fragment sizeMarton Balint2021-03-12
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avdevice/alsa_dec: make sure we have enough data in non-blocking modeMarton Balint2021-03-12
| | | | | | | Otherwise we might return 1-2 samples per packet if av_read_frame() call rate is only sligthly less than the stream sample rate. Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec: add a get_encode_buffer() callback to AVCodecContextJames Almer2021-03-12
| | | | | | | | | | | This callback is functionally the same as get_buffer2() is for decoders, and implements for the new encode API the functionality of the old encode API had where the user could provide their own buffers. Reviewed-by: Lynne <dev@lynne.ee> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* cbs_sei: Detect payload overflows when reading SEI messagesMark Thompson2021-03-12
| | | | | | | | | | The top-level GetBitContext is sized for the whole NAL unit, so it fails to detect overflows where a payload continues into the following message. To fix that, we make a new context on the stack for reading each payload. Fixes: 29892/clusterfuzz-testcase-minimized-ffmpeg_BSF_H264_REDUNDANT_PPS_fuzzer-6310830956216320 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Tested-by: Michael Niedermayer <michael@niedermayer.cc>
* cbs_h265: Detect more reference combinations which would overflow the DPBMark Thompson2021-03-12
| | | | | | | | | | | | | | | | | | | | | In total, the number of short term references (from the selected short term ref pic set), the number of long term references (combining both the used candidates from the SPS and those defined in the slice header) and the number of instances of the current picture (usually one, but can be two if current picture reference is enabled) must never exceed the size of the DPB. This is a generalisation of the condition associated with num_long_term_pics in 7.4.7.1. We use this to apply tighter bounds to the number of long term pictures referred to in the slice header, and also to detect the invalid case where the second reference to the current picture would not fit in the DPB (this case can't be detected earlier because an STRPS with 15 pictures can still be valid in the same stream when used with a different PPS which does not require two DPB slots for the current picture). Fixes: 24913/clusterfuzz-testcase-minimized-ffmpeg_BSF_HEVC_METADATA_fuzzer-6261760693370880 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Tested-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/cbs_h26[45]: Remove redundant enum constantsAndreas Rheinhardt2021-03-12
| | | | | | | Unused since 8843607f495c95c1e67a3ce3d6f15dca6e252439. Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/cbs_sei: Fix leak of AVBufferRef on errorAndreas Rheinhardt2021-03-12
| | | | | | | | | | | | | | | An AVBufferRef (and the corresponding AVBuffer and the underlying actual buffer) would leak in ff_cbs_sei_add_message() on error in case an error happened after its creation and before it has been attached to more permanent storage. Fix this by only creating the AVBufferRef immediately before attaching it to its intended target position. (Given that no SEI message currently created is refcounted, the above can't happen at the moment. But Coverity already nevertheless noticed: This commit fixes Coverity issue #1473521.) Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/cbs_sei: Don't use -1th element of arrayAndreas Rheinhardt2021-03-12
| | | | | | | | (This affected only suffix SEI messages; yet no such SEI messages are currently inserted.) Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/cbs: Remove redundant checks for CodedBitstreamContext.codecAndreas Rheinhardt2021-03-12
| | | | | | | | | | | | | Setting this field happens immediately after the allocation in ff_cbs_init(), so the whole CBS code may presume that any CodedBitstreamContext has this set. Lots of code already presumed this, yet ff_cbs_close() did it inconsistently: It checked before checking whether the CodedBitstreamType has a close function; yet it simply unconditionally read ctx->codec->priv_class. Coverity complained about this in issue #1473564, which this commit fixes. Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/nvenc: base timestamps on frameIntervalPMartin Storsjö2021-03-12
| | | | | | | | | | | | | If b-frames were enabled implicitly (if max_b_frames wasn't set by the caller at all, since a0949d0bcb0eee2f3fffcf9a4810c0295d14c0dc), we wouldn't offset dts at all, producing invalid pts/dts combinations (causing loud warnings by ffmpeg, or muxer errors if passed without an extra cleanup pass). Instead use frameIntervalP for offsetting, which should always be accurate. Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avfilter/vf_uspp: Fix leak of packet side dataAndreas Rheinhardt2021-03-12
| | | | | | | | | | | The uspp filter uses a special option ("no_bitstream") of the Snow encoder to suppress it from generating output. The filter therefore did not unref the packet after usage, believing it to be blank. But this is wrong, as the Snow encoder attaches quality stats side data to the packet. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/vf_uspp: Fix leak of qp-table on errorAndreas Rheinhardt2021-03-12
| | | | | | | Fixes Coverity issue #1473500. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>