summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* avformat/flac_picture: Switch to bytestream2 APIAndreas Rheinhardt2019-12-01
| | | | | | | | | | | | | | | | | | | ff_flac_parse_picture() parses a buffer containing a flac metadata picture block by wrapping it in an AVIOContext and using the AVIOContext API. Consequently, when not enough data could be read AVERROR(EIO) was returned although reading didn't really fail: A block that contains a subfield whose size field indicates that it is so big as to extend beyond the buffer is just invalid. This commit changes this by using the bytestream2 API instead; furthermore, the checks for whether there is enough data left are performed before allocating a buffer for said data. Finally, if the length of the picture description is bigger than INT_MAX, it will now raise an error. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/flac_picture: Simplify checksAndreas Rheinhardt2019-12-01
| | | | | | | | | | | | | | | | | | During parsing a flac picture metadata block, the mimetype is read as follows: Its 32b size field is read and checked for being in the range 1..63; afterwards, the actual mimetype-string is read into a buffer of size 64, where the length to read is the minimum of the length field and the size of the destination buffer -1. Then an assert guards that length is indeed < the size of the destination buffer before the string in the buffer is zero-terminated. The FFMIN as well as the assert are actually redundant, as it has been checked that the string (even after terminating) fits into the buffer. In order to make this clear, reword the check "len >= 64" to "len >= sizeof(mimetype)" and drop the FFMIN as well as the assert. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/smoothstreamingenc: removed unused check of avformat_free_contextSteven Liu2019-12-02
| | | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Reviewed-by: Jun Zhao <barryjzhao@tencent.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/rtpenc_mpegts: removed unused check of avformat_free_contextSteven Liu2019-12-02
| | | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Reviewed-by: Jun Zhao <barryjzhao@tencent.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hdsenc: removed unused check of avformat_free_contextSteven Liu2019-12-02
| | | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Reviewed-by: Jun Zhao <barryjzhao@tencent.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/dashenc: remove unused check of avformat_free_contextSteven Liu2019-12-02
| | | | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Reviewed-by: Jun Zhao <barryjzhao@tencent.com> Reviewed-by: Jeyapal, Karthick <kjeyapal@akamai.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/avc: add missing return error valueJames Almer2019-11-30
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* lavc/extract_extradata: Use bytestream apiAndriy Gelman2019-11-30
| | | | | Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/extract_extradata_bsf: Don't unref uninitialized buffersAndreas Rheinhardt2019-11-30
| | | | | | | | This happens if allocating extradata fails and s->remove is unset. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/avc: fix sps buffer offset when calling ff_avc_decode_sps()James Almer2019-11-29
| | | | | | Skip the avcC specific size bytes and the NAL header bits. Signed-off-by: James Almer <jamrial@gmail.com>
* fate/demux: add an AV1 Annex B testJames Almer2019-11-29
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/av1_parser: export stream dimensions in avctxJames Almer2019-11-29
| | | | | | This is required to demux annexb samples when a decoder isn't available. Signed-off-by: James Almer <jamrial@gmail.com>
* fate/lavf-container: add an H264 mp4 remux testJames Almer2019-11-29
| | | | | | | This uses a raw h264 bitstream as source, in order to test the avcC generation code. Signed-off-by: James Almer <jamrial@gmail.com>
* fate/lavf-container: add an AV1 mp4 remux testJames Almer2019-11-29
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* libavdevice/lavfi: check avfilter_graph_dump return valueZhao Zhili2019-11-29
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/avio: Use ffurl_closepAndreas Rheinhardt2019-11-29
| | | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/vf_hqdn3d: add support for commandsPaul B Mahol2019-11-29
|
* avfilter/vf_hqdn3d: add support for 12bit and 14bit yuv formatsPaul B Mahol2019-11-29
|
* lavc/mvha: Check init_get_bits8() for failureJun Zhao2019-11-29
| | | | | | fix potential null pointer dereference Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavf/vividas: check avformat_new_stream() returnJun Zhao2019-11-29
| | | | | | | check avformat_new_stream() return. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avfilter/vf_yadif: rename config_props -> config_output, link -> outlinkLimin Wang2019-11-29
| | | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: Avoid allocation of AVIOContextAndreas Rheinhardt2019-11-29
| | | | | | | | | | Put an AVIOContext whose lifetime doesn't extend beyond the function where it is allocated on the stack instead of allocating and freeing it. This also avoids the need to free it, which in this case fixes possible memleaks on error. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/avc: write the missing bits in the AVC Decoder Configuration BoxJames Almer2019-11-28
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/movenc: Avoid allocation for small dynamic buffersAndreas Rheinhardt2019-11-28
| | | | | | | | By using avio_get_dyn_buf() + ffio_free_dyn_buf() instead of avio_close_dyn_buf() + av_free() one can avoid an allocation + copy for small dynamic buffers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/matroskaenc: Avoid allocation for small dynamic buffersAndreas Rheinhardt2019-11-28
| | | | | | | | By using avio_get_dyn_buf() + ffio_free_dyn_buf() instead of avio_close_dyn_buf() + av_free() one can avoid an allocation + copy for small dynamic buffers (i.e. small master elements). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/id3v2enc: Avoid allocation for small tagsAndreas Rheinhardt2019-11-28
| | | | | | | | By using avio_get_dyn_buf() + ffio_free_dyn_buf() instead of avio_close_dyn_buf() + av_free() one can avoid an allocation + copy for small tags. Furthermore, it simplifies freeing. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/avc: Avoid allocation for small SPS/PPS arraysAndreas Rheinhardt2019-11-28
| | | | | | | | By using avio_get_dyn_buf() + ffio_free_dyn_buf() instead of avio_close_dyn_buf() + av_free() one can avoid an allocation + copy for small extradata. Furthermore, it simplifies freeing. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/av1: Avoid allocation for small headersAndreas Rheinhardt2019-11-28
| | | | | | | | By using avio_get_dyn_buf() + ffio_free_dyn_buf() instead of avio_close_dyn_buf() + av_free() one can avoid an allocation + copy for small headers. Furthermore, it simplifies freeing. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/apetag: Avoid allocation for small tagsAndreas Rheinhardt2019-11-28
| | | | | | | | By using avio_get_dyn_buf() + ffio_free_dyn_buf() instead of avio_close_dyn_buf() + av_free() one can avoid an allocation + copy for small tags. Furthermore, it simplifies freeing. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/aviobuf: Avoid allocating buffer when using dynamic bufferAndreas Rheinhardt2019-11-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up until now, using a dynamic buffer entailed at least three allocations: One for the AVIOContext, one for the AVIOContext's opaque (which, among other things, contains the small write buffer), and one for the big buffer that is independently allocated that is returned when calling avio_close_dyn_buf(). It is possible to avoid the third allocation if one doesn't use a packetized dynamic buffer, if all the data written so far fit into the write buffer and if one does not require the actual (big) buffer to have an indefinite lifetime. This is done by making avio_get_dyn_buf() return a pointer to the data in the write buffer if nothing has been written to the main buffer yet. The dynamic buffer will then be freed using ffio_free_dynamic_buffer (which needed to be modified not to call avio_close_dyn_buf() internally). So a typical use-case like: size = avio_close_dyn_buf(dyn_pb, &buf); do something with buf av_free(buf); can be converted to: size = avio_get_dyn_buf(dyn_pb, &buf); do something with buf ffio_free_dynamic_buffer(&dyn_pb); In more complex scenarios this can simplify freeing as well, because it is now clear that freeing always has to be performed via ffio_free_dynamic_buffer(). Of course, in case this saves an allocation it also saves a memcpy. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/vf_libvmaf: Check for av_frame_alloc failureLimin Wang2019-11-28
| | | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/flacenc: Add const to ff_flac_write_header() parameterAndreas Rheinhardt2019-11-28
| | | | | | | The extradata is not changed at all. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vp8: fix multiple ff_thread_finish_setup() callsZhao Zhili2019-11-28
| | | | | | | | | | webp decoder doesn't set update_thread_context field $ ffmpeg -i rgb_q80.webp -f null - [webp @ 0x7ffbd5823200] Multiple ff_thread_finish_setup() calls Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/vf_colorconstancy: av_frame_free(&in) in case of error or direct ↵Limin Wang2019-11-28
| | | | | | | | flag is false Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/qsvenc: Fix some code indentationsLinjie Fu2019-11-28
| | | | Signed-off-by: Linjie Fu <linjie.fu@intel.com>
* doc/encoder: add the missing qsv encodersZhong Li2019-11-28
| | | | | Reviewed-by: Gyan Doshi <ffmpeg@gyani.pro> Signed-off-by: Zhong Li <zhongli_dev@126.com>
* lavc/rav1e: log and doc updated for const quantizer modeZhong Li2019-11-28
| | | | Signed-off-by: Zhong Li <zhongli_dev@126.com>
* Add options for spatial layers.Thierry Foucu2019-11-28
| | | | | | | | Disable by default to output all the layers, to match libaomdec wrapper. Add option to select the operating point for the spatial layers. Update the documentation with the new options. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: add mvha video decoderPaul B Mahol2019-11-27
|
* avcodec: add mvdv video decoderPaul B Mahol2019-11-27
|
* avformat/hls: correct grammatical errors of m3u8_hold_counters optionSteven Liu2019-11-27
| | | | | | Suggested-by: Gyan <ffmpeg@gyani.pro> Suggested-by: Rodney Baker <rodney.baker@iinet.net.au> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* lavc/qsvenc: Fix compilation for some build environments.Carl Eugen Hoyos2019-11-27
| | | | Reported and tested by Sean Darcy.
* avutil/hwcontext_cuda: allow using primary CUDA device contextOleg Dobkin2019-11-26
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avformat/hlsenc: set strict_std_compliance from the parent AVFormatContextSteven Liu2019-11-26
| | | | | | | fix ticket: 8388 Reviewed-by: Jan Ekström <jeebjp@gmail.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avcodec/v210dec: add support for frame and slice threadingLimin Wang2019-11-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1, Test server configure: [root@localhost ~]# cat /proc/cpuinfo |grep "model name" model name : Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz model name : Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz ... [root@localhost ~]# free -h total used free shared buff/cache available Mem: 102G 1.1G 100G 16M 657M 100G Swap: 4.0G 0B 4.0G 2, Test result: encode the v210 input data for testing: ./ffmpeg -y -i 4k_422.ts -c:v v210 -vframes 10 test.avi master: ./ffmpeg -y -threads 1 -stream_loop 1000 -i ./test.avi -benchmark -f null - frame=10010 fps= 60 q=-0.0 Lsize=N/A time=00:38:26.30 bitrate=N/A speed=13.7x video:5240kB audio:432432kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown bench: utime=101.869s stime=66.181s rtime=167.996s bench: maxrss=186552kB patch applied: ./ffmpeg -y -threads 2 -thread_type slice -stream_loop 1000 -i ./test.avi -benchmark -f null - frame=10010 fps= 72 q=-0.0 Lsize=N/A time=00:38:26.30 bitrate=N/A speed=16.5x video:5240kB audio:432432kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown bench: utime=103.562s stime=74.858s rtime=139.599s bench: maxrss=188616kB ./ffmpeg -y -threads 2 -thread_type frame -stream_loop 1000 -i ./test.avi -benchmark -f null - frame=10010 fps= 85 q=-0.0 Lsize=N/A time=00:38:26.30 bitrate=N/A speed=19.6x video:5240kB audio:432432kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown bench: utime=114.310s stime=92.685s rtime=117.693s bench: maxrss=231896kB Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/v410dec: add support for frame and slice threadingLimin Wang2019-11-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1, Test server configure: [root@localhost ~]# cat /proc/cpuinfo |grep "model name" model name : Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz model name : Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz ... [root@localhost ~]# free -h total used free shared buff/cache available Mem: 102G 1.1G 100G 16M 657M 100G Swap: 4.0G 0B 4.0G 2, Test result: encode the v410 input data for testing: ./ffmpeg -y -i 4k_422.ts -c:v v410 -vframes 10 test.avi master: ./ffmpeg -y -stream_loop 1000 -i ./test.avi -benchmark -f null - frame=10010 fps= 37 q=-0.0 Lsize=N/A time=00:38:26.30 bitrate=N/A speed= 8.6x video:5240kB audio:432432kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown bench: utime=166.016s stime=102.192s rtime=268.120s bench: maxrss=273400kB patch applied: ./ffmpeg -y -threads 2 -thread_type slice -stream_loop 1000 -i ./test.avi -benchmark -f null - frame=10010 fps= 53 q=-0.0 Lsize=N/A time=00:38:26.30 bitrate=N/A speed=12.3x video:5240kB audio:432432kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown bench: utime=165.135s stime=100.456s rtime=187.994s bench: maxrss=275476kB ./ffmpeg -y -threads 2 -thread_type frame -stream_loop 1000 -i ./test.avi -benchmark -f null - frame=10010 fps= 61 q=-0.0 Lsize=N/A time=00:38:26.30 bitrate=N/A speed=14.1x video:5240kB audio:432432kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown bench: utime=171.386s stime=122.102s rtime=163.637s bench: maxrss=340308kB Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/hls: add option for the m3u8 list load max timesSteven Liu2019-11-25
| | | | | | | set max times for load m3u8 when the m3u8 list refresh do not with new segments any times. Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avcodec/nuv: Use ff_set_dimensions()Michael Niedermayer2019-11-25
| | | | | | | | | Fixes: OOM Fixes: 18956/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_NUV_fuzzer-5766505644163072 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>
* avformat/vividas: Error out on audio packets in the absence of audio streamsMichael Niedermayer2019-11-25
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: Check and require 1 video streamMichael Niedermayer2019-11-25
| | | | | | | | | | | The decoder hardcodes that audio is stream_id = 1 so it does not currently work with more or less than 1 video stream at st=0 Fixes: assertion failure Fixes: 18602/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6259277199310848 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>