]> git.sesse.net Git - ffmpeg/log
ffmpeg
4 years agoavcodec/iff: Check available space before entering loop in decode_long_vertical_delta...
Michael Niedermayer [Wed, 23 Oct 2019 21:31:03 +0000 (23:31 +0200)]
avcodec/iff: Check available space before entering loop in decode_long_vertical_delta2() / decode_long_vertical_delta()

Fixes: Timeout (31sec -> 41ms)
Fixes: 18380/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5645210121404416
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/apedec: Fix integer overflow in filter_3800()
Michael Niedermayer [Sun, 20 Oct 2019 22:26:25 +0000 (00:26 +0200)]
avcodec/apedec: Fix integer overflow in filter_3800()

Fixes: signed integer overflow: 2117181180 + 60483298 cannot be represented in type 'int'
Fixes: 18344/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5685327791915008
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/atrac3plusdec: add FF_CODEC_CAP_INIT_CLEANUP
Michael Niedermayer [Sat, 19 Oct 2019 17:32:12 +0000 (19:32 +0200)]
avcodec/atrac3plusdec: add FF_CODEC_CAP_INIT_CLEANUP

Fixes: memleaks
Fixes: 18332/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ATRAC3P_fuzzer-5655654374572032
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavutil/lfg: Document the AVLFG struct
Michael Niedermayer [Sun, 20 Oct 2019 10:12:12 +0000 (12:12 +0200)]
avutil/lfg: Document the AVLFG struct

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/decode: Also consider channels in max_samples check
Michael Niedermayer [Fri, 18 Oct 2019 20:24:04 +0000 (22:24 +0200)]
avcodec/decode: Also consider channels in max_samples check

Fixes: Timeout (109sec -> 0.6sec)
Fixes: 18309/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INTERPLAY_ACM_fuzzer-6226598168100864
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/rasc: Check input size in decode_fint()
Michael Niedermayer [Thu, 17 Oct 2019 21:57:26 +0000 (23:57 +0200)]
avcodec/rasc: Check input size in decode_fint()

Fixes: Timeout (11sec -> 42ms)
Fixes: 18287/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RASC_fuzzer-5637866331308032
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/ffv1dec: Use a different error message for the slice level CRC
Michael Niedermayer [Thu, 17 Oct 2019 21:22:22 +0000 (23:22 +0200)]
avcodec/ffv1dec: Use a different error message for the slice level CRC

This way they can be told apart easily

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/apedec: Fix undefined integer overflow in long_filter_ehigh_3830()
Michael Niedermayer [Thu, 17 Oct 2019 18:56:23 +0000 (20:56 +0200)]
avcodec/apedec: Fix undefined integer overflow in long_filter_ehigh_3830()

Fixes: signed integer overflow: -1094995529 * 2 cannot be represented in type 'int'
Fixes: 18281/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5692589180715008
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/flvenc: Check pts for mpeg4/h264 (which need the value)
Michael Niedermayer [Tue, 15 Oct 2019 20:18:45 +0000 (22:18 +0200)]
avformat/flvenc: Check pts for mpeg4/h264 (which need the value)

Fixes: Ticket8152
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/dstdec: Check that AC probabilities are within range
Michael Niedermayer [Tue, 15 Oct 2019 21:42:50 +0000 (23:42 +0200)]
avcodec/dstdec: Check that AC probabilities are within range

ISO/IEC 14496-3:2005(E): "Each entry of P_one[ ][ ] is in the range of 1 to
128, corresponding to a probability of 1/256 to 128/256 of the next error bit (bit E, See Figure 10.5)..."

Fixes: Timeout (42sec ->1sec)
Fixes: 18181/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DST_fuzzer-5736646250594304
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/dstdec: Check read_table() for failure
Michael Niedermayer [Tue, 15 Oct 2019 21:40:21 +0000 (23:40 +0200)]
avcodec/dstdec: Check read_table() for failure

Fixes: Timeout (too long -> 42sec)
Fixes: 18181/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DST_fuzzer-5736646250594304
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/vc1_block: Check input in the block decode loops
Michael Niedermayer [Sat, 12 Oct 2019 14:59:46 +0000 (16:59 +0200)]
avcodec/vc1_block: Check input in the block decode loops

Fixes: Timeout (196sec -> 2sec)
Fixes: 18026/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1_fuzzer-5640941108461568
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/vc1_block: Check for end of bitstream at the top of vc1_decode_i_blocks_adv()
Michael Niedermayer [Sat, 28 Sep 2019 20:44:18 +0000 (22:44 +0200)]
avcodec/vc1_block: Check for end of bitstream at the top of vc1_decode_i_blocks_adv()

Fixes: Timeout (147sec -> 2sec)
Fixes: 17704/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5723851098423296
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agotools/target_dec_fuzzer: Adjust threshold for smacker
Michael Niedermayer [Thu, 10 Oct 2019 16:51:19 +0000 (18:51 +0200)]
tools/target_dec_fuzzer: Adjust threshold for smacker

Fixes: Timeout (65sec -> 0.5sec)
Fixes: 18072/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMACKER_fuzzer-5722709366931456
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/hqx: Check the input data against the image size
Michael Niedermayer [Sat, 20 Jul 2019 21:37:38 +0000 (23:37 +0200)]
avcodec/hqx: Check the input data against the image size

Fixes: Timeout (22 -> 100 ms)
Fixes: 15173/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HQX_fuzzer-5662556846292992
Fixes: 17896/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HQX_fuzzer-5679312077848576
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/pafvideo: Only clear frame when it was written to
Michael Niedermayer [Tue, 6 Aug 2019 21:07:01 +0000 (23:07 +0200)]
avcodec/pafvideo: Only clear frame when it was written to

This avoids unneeded operations and makes the code faster.

Fixes: Timeout
Fixes: 15724/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PAF_VIDEO_fuzzer-5750842205929472 (12sec -> 9sec)
Fixes: 17625/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PAF_VIDEO_fuzzer-5640515311108096 (16sec -> 4sec)
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/vividas: Fix n_sb_blocks Check
Michael Niedermayer [Mon, 14 Oct 2019 21:17:51 +0000 (23:17 +0200)]
avformat/vividas: Fix n_sb_blocks Check

Fixes: signed integer overflow: 1540265776 * 2 cannot be represented in type 'int'
Fixes: 18160/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5758808818712576
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/snowenc: Set mb_num to avoid ratecontrol floating point divisions by 0.0
Michael Niedermayer [Mon, 14 Oct 2019 21:03:50 +0000 (23:03 +0200)]
avcodec/snowenc: Set mb_num to avoid ratecontrol floating point divisions by 0.0

Fixes: Ticket7990
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/snowenc: Fix 2 undefined shifts
Michael Niedermayer [Mon, 14 Oct 2019 20:51:57 +0000 (22:51 +0200)]
avcodec/snowenc: Fix 2 undefined shifts

Fixes: Ticket7990
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/mlvdec:drop unnecessary check before ff_format_io_close
Steven Liu [Sat, 9 Nov 2019 02:27:14 +0000 (11:27 +0900)]
avformat/mlvdec:drop unnecessary check before ff_format_io_close

Reviewed-by: Linjie Fu <linjie.fu@intel.com>
Reviewed-by: Jun Zhao <barryjzhao@tencent.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
4 years agoavcodec/libvpxenc,cosmetics: fix a typo
James Zern [Sat, 9 Nov 2019 01:48:29 +0000 (17:48 -0800)]
avcodec/libvpxenc,cosmetics: fix a typo

predicition -> prediction

4 years agoavcodec/libvpxdec.c,cosmetics: bpp -> bpc
James Zern [Wed, 6 Nov 2019 22:05:23 +0000 (14:05 -0800)]
avcodec/libvpxdec.c,cosmetics: bpp -> bpc

Signed-off-by: James Zern <jzern@google.com>
4 years agoavfilter/Makefile: add missing framesync dependency to bm3d & mix filters
Lou Logan [Wed, 6 Nov 2019 19:37:09 +0000 (10:37 -0900)]
avfilter/Makefile: add missing framesync dependency to bm3d & mix filters

Signed-off-by: Lou Logan <lou@lrcd.com>
4 years agoconfigure: select missing rdft for several filters
Lou Logan [Wed, 6 Nov 2019 19:35:28 +0000 (10:35 -0900)]
configure: select missing rdft for several filters

afir, sinc, superequalizer, surround

For afir fft is replaced with rdft as:
rdft_select="fft"

Signed-off-by: Lou Logan <lou@lrcd.com>
4 years agoavfilter/vf_dnn_processing: correct duplicate statement
leozhang [Fri, 8 Nov 2019 03:55:10 +0000 (11:55 +0800)]
avfilter/vf_dnn_processing: correct duplicate statement

Signed-off-by: leozhang <leozhang@qiyi.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/vf_dnn_processing: fix fate-source
Guo, Yejun [Fri, 8 Nov 2019 07:51:40 +0000 (15:51 +0800)]
avfilter/vf_dnn_processing: fix fate-source

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/mxfdec: cleanup on "essence prior to first PartitionPack"
Michael Niedermayer [Thu, 31 Oct 2019 12:30:52 +0000 (13:30 +0100)]
avformat/mxfdec: cleanup on "essence prior to first PartitionPack"

Fixes: memleak
Fixes: 18473/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5738557074833408
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/f_metadata: remove unneeded code
Limin Wang [Thu, 10 Oct 2019 06:03:54 +0000 (14:03 +0800)]
avfilter/f_metadata: remove unneeded code

Reviewed-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agolavf/dashdec: drop unnecessary check before ff_format_io_close
Jun Zhao [Mon, 23 Sep 2019 16:30:17 +0000 (00:30 +0800)]
lavf/dashdec: drop unnecessary check before ff_format_io_close

ff_format_io_close will check the AVIOContext pointer pb, so drop
the unnecessary check before ff_format_io_close.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavf/dashenc: enable probesize/max_analyze_duration setting in sub-demuxer
Jun Zhao [Sat, 2 Nov 2019 14:46:00 +0000 (22:46 +0800)]
lavf/dashenc: enable probesize/max_analyze_duration setting in sub-demuxer

Enable probesize/max_analyze_duration setting when open the sub-demuxer,
it's will be used to minimizing the initial delay.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavf/hls: support probesize/max_analyze_duration when open sub-demuxer
Jun Zhao [Sat, 2 Nov 2019 11:48:28 +0000 (19:48 +0800)]
lavf/hls: support probesize/max_analyze_duration when open sub-demuxer

Add probesize/max_analyze_duration support when open the sub-demuxer,
it's will be used to minimizing the initial delay.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavf/flvenc: Cosmetics: fix indentation
Jun Zhao [Sat, 2 Nov 2019 11:59:45 +0000 (19:59 +0800)]
lavf/flvenc: Cosmetics: fix indentation

fix indentation

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavf/mov: add log context dump in log message
Jun Zhao [Sun, 27 Oct 2019 02:01:30 +0000 (10:01 +0800)]
lavf/mov: add log context dump in log message

add log context dump in log message.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavf/hls: fix the log context setting in log message
Jun Zhao [Sun, 27 Oct 2019 02:00:24 +0000 (10:00 +0800)]
lavf/hls: fix the log context setting in log message

Fix the log context setting in log message

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agoavfilter/vf_dnn_processing: add a generic filter for image proccessing with dnn networks
Guo, Yejun [Thu, 31 Oct 2019 08:33:02 +0000 (16:33 +0800)]
avfilter/vf_dnn_processing: add a generic filter for image proccessing with dnn networks

This filter accepts all the dnn networks which do image processing.
Currently, frame with formats rgb24 and bgr24 are supported. Other
formats such as gray and YUV will be supported next. The dnn network
can accept data in float32 or uint8 format. And the dnn network can
change frame size.

The following is a python script to halve the value of the first
channel of the pixel. It demos how to setup and execute dnn model
with python+tensorflow. It also generates .pb file which will be
used by ffmpeg.

import tensorflow as tf
import numpy as np
import imageio
in_img = imageio.imread('in.bmp')
in_img = in_img.astype(np.float32)/255.0
in_data = in_img[np.newaxis, :]
filter_data = np.array([0.5, 0, 0, 0, 1., 0, 0, 0, 1.]).reshape(1,1,3,3).astype(np.float32)
filter = tf.Variable(filter_data)
x = tf.placeholder(tf.float32, shape=[1, None, None, 3], name='dnn_in')
y = tf.nn.conv2d(x, filter, strides=[1, 1, 1, 1], padding='VALID', name='dnn_out')
sess=tf.Session()
sess.run(tf.global_variables_initializer())
output = sess.run(y, feed_dict={x: in_data})
graph_def = tf.graph_util.convert_variables_to_constants(sess, sess.graph_def, ['dnn_out'])
tf.train.write_graph(graph_def, '.', 'halve_first_channel.pb', as_text=False)
output = output * 255.0
output = output.astype(np.uint8)
imageio.imsave("out.bmp", np.squeeze(output))

To do the same thing with ffmpeg:
- generate halve_first_channel.pb with the above script
- generate halve_first_channel.model with tools/python/convert.py
- try with following commands
  ./ffmpeg -i input.jpg -vf dnn_processing=model=halve_first_channel.model:input=dnn_in:output=dnn_out:fmt=rgb24:dnn_backend=native -y out.native.png
  ./ffmpeg -i input.jpg -vf dnn_processing=model=halve_first_channel.pb:input=dnn_in:output=dnn_out:fmt=rgb24:dnn_backend=tensorflow -y out.tf.png

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
4 years agofftools/ffmpeg_opt: Fix mixed declarations and code
Andreas Rheinhardt [Wed, 6 Nov 2019 12:18:16 +0000 (13:18 +0100)]
fftools/ffmpeg_opt: Fix mixed declarations and code

Introduced in ed3c317d.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/extract_extradata_bsf: fix typo in comments
leozhang [Wed, 6 Nov 2019 07:00:59 +0000 (15:00 +0800)]
avcodec/extract_extradata_bsf: fix typo in comments

Signed-off-by: leozhang <leozhang@qiyi.com>
Reviewed-by: Gyan <ffmpeg@gyani.pro>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavdevice/v4l2: Remove av_assert0 when format not supported
Andriy Gelman [Tue, 5 Nov 2019 03:32:59 +0000 (22:32 -0500)]
avdevice/v4l2: Remove av_assert0 when format not supported

Before this commit an av_assert0 would fail if a v4l2 device did not
support a target format.
For example,
./ffmpeg -f v4l2 -codec:v h264 -i /dev/video0 -f mpegts -
would signal an abort if /dev/video0 did not support h264.

The new behaviour is to return an AVERROR(EINVAL) error code. An
av_assert0 has been added to verify this return.

Fixes #6629

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/Makefile: add missing msmpeg4* dependencies to wmv1 encoder
Lou Logan [Tue, 5 Nov 2019 19:28:07 +0000 (10:28 -0900)]
avcodec/Makefile: add missing msmpeg4* dependencies to wmv1 encoder

Signed-off-by: Lou Logan <lou@lrcd.com>
4 years agoavcodec/Makefile: add missing h263data dependency to snow encoder
Lou Logan [Tue, 5 Nov 2019 19:21:10 +0000 (10:21 -0900)]
avcodec/Makefile: add missing h263data dependency to snow encoder

Signed-off-by: Lou Logan <lou@lrcd.com>
4 years agoavcodec/Makefile: add missing vorbis_data dependency to opus encoder
Lou Logan [Tue, 5 Nov 2019 19:17:01 +0000 (10:17 -0900)]
avcodec/Makefile: add missing vorbis_data dependency to opus encoder

Signed-off-by: Lou Logan <lou@lrcd.com>
4 years agoconfigure: select mdct for dca encoder
Lou Logan [Tue, 5 Nov 2019 19:01:55 +0000 (10:01 -0900)]
configure: select mdct for dca encoder

Signed-off-by: Lou Logan <lou@lrcd.com>
4 years agoavcodec/dvdec: correctly decode bottom mb row in 1080i field mode
Baptiste Coudurier [Tue, 18 Jun 2019 20:29:41 +0000 (13:29 -0700)]
avcodec/dvdec: correctly decode bottom mb row in 1080i field mode

4 years agoavcodec/dvdec: correctly set interlaced and tff
Baptiste Coudurier [Fri, 28 Jun 2019 17:33:05 +0000 (10:33 -0700)]
avcodec/dvdec: correctly set interlaced and tff

4 years agoavcodec/libvpxdec: reject video and alpha dimension mismatches
Marton Balint [Sun, 27 Oct 2019 17:10:36 +0000 (18:10 +0100)]
avcodec/libvpxdec: reject video and alpha dimension mismatches

Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: James Zern <jzern@google.com>
4 years agoavcodec/libvpxdec: decode to custom framebuffers for vp9
Marton Balint [Sun, 27 Oct 2019 17:10:35 +0000 (18:10 +0100)]
avcodec/libvpxdec: decode to custom framebuffers for vp9

This avoids copying the full frame after decoding.

Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: James Zern <jzern@google.com>
4 years agoavcodec/libvpxdec: pass decoder instances to vpx_init directly
Marton Balint [Sun, 27 Oct 2019 17:10:34 +0000 (18:10 +0100)]
avcodec/libvpxdec: pass decoder instances to vpx_init directly

If the alpha decoder init failed we presented the error message from the normal
decoder. This change should prevent such mistakes.

Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: James Zern <jzern@google.com>
4 years agoavcodec/libvpxdec: make sure BlockAdditional side data size >= 8
Marton Balint [Sun, 27 Oct 2019 17:10:33 +0000 (18:10 +0100)]
avcodec/libvpxdec: make sure BlockAdditional side data size >= 8

Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: James Zern <jzern@google.com>
4 years agoavcodec/libvpxenc: only allocate alpha U/V planes on size changes
Marton Balint [Sat, 2 Nov 2019 16:20:21 +0000 (17:20 +0100)]
avcodec/libvpxenc: only allocate alpha U/V planes on size changes

Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: James Zern <jzern@google.com>
4 years agoavcodec/libvpxenc: fix alpha stride
Marton Balint [Sun, 27 Oct 2019 17:10:31 +0000 (18:10 +0100)]
avcodec/libvpxenc: fix alpha stride

Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: James Zern <jzern@google.com>
4 years agoavformat/nutenc: Do not pass NULL to memcmp() in get_needed_flags()
Michael Niedermayer [Fri, 1 Nov 2019 09:02:29 +0000 (10:02 +0100)]
avformat/nutenc: Do not pass NULL to memcmp() in get_needed_flags()

This compared to the other suggestions is cleaner and easier to understand
keeping the condition in the if() simple.

This affects alot of fate tests.

See: [FFmpeg-devel] [PATCH 05/11] avformat/nutenc: Don't pass NULL to memcmp
See: [FFmpeg-devel] [PATCH]lavf/nutenc: Do not call memcmp() with NULL argument

Fixes: Ticket 7980
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agodoc/bitstream_filters: Fix copy an paste typo
Limin Wang [Mon, 4 Nov 2019 11:09:59 +0000 (19:09 +0800)]
doc/bitstream_filters: Fix copy an paste typo

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoconfigure: select bswapdsp for ylc decoder
Lou Logan [Mon, 4 Nov 2019 23:25:31 +0000 (14:25 -0900)]
configure: select bswapdsp for ylc decoder

Signed-off-by: Lou Logan <lou@lrcd.com>
4 years agoconfigure: select fft for qdmc decoder
Lou Logan [Mon, 4 Nov 2019 23:23:41 +0000 (14:23 -0900)]
configure: select fft for qdmc decoder

Signed-off-by: Lou Logan <lou@lrcd.com>
4 years agoconfigure: select bswapdsp for mdec decoder
Lou Logan [Mon, 4 Nov 2019 23:20:10 +0000 (14:20 -0900)]
configure: select bswapdsp for mdec decoder

Signed-off-by: Lou Logan <lou@lrcd.com>
4 years agoconfigure: select bswapdsp for imm4 decoder
Lou Logan [Mon, 4 Nov 2019 23:14:41 +0000 (14:14 -0900)]
configure: select bswapdsp for imm4 decoder

Signed-off-by: Lou Logan <lou@lrcd.com>
4 years agoavcodec/Makefile: add missing ass dependency to ccaption decoder
Lou Logan [Mon, 4 Nov 2019 23:12:24 +0000 (14:12 -0900)]
avcodec/Makefile: add missing ass dependency to ccaption decoder

Signed-off-by: Lou Logan <lou@lrcd.com>
4 years agoconfigure: select audiodsp for acelp_kelvin decoder
Lou Logan [Mon, 4 Nov 2019 23:10:11 +0000 (14:10 -0900)]
configure: select audiodsp for acelp_kelvin decoder

Signed-off-by: Lou Logan <lou@lrcd.com>
4 years agoconfigure: select mdct for atrac3al decoder
Lou Logan [Mon, 4 Nov 2019 23:06:22 +0000 (14:06 -0900)]
configure: select mdct for atrac3al decoder

Signed-off-by: Lou Logan <lou@lrcd.com>
4 years agoconfigure: select mdct & sinewin for atrac3pal decoder
Lou Logan [Mon, 4 Nov 2019 23:01:45 +0000 (14:01 -0900)]
configure: select mdct & sinewin for atrac3pal decoder

Signed-off-by: Lou Logan <lou@lrcd.com>
4 years agoavformat/Makefile: add missing pcm dependency to sdx demuxer
Lou Logan [Fri, 1 Nov 2019 22:18:35 +0000 (14:18 -0800)]
avformat/Makefile: add missing pcm dependency to sdx demuxer

Signed-off-by: Lou Logan <lou@lrcd.com>
Signed-off-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
4 years agoavformat/Makefile: add missing pcm dependency to nsp demuxer
Lou Logan [Fri, 1 Nov 2019 22:14:44 +0000 (14:14 -0800)]
avformat/Makefile: add missing pcm dependency to nsp demuxer

Signed-off-by: Lou Logan <lou@lrcd.com>
Signed-off-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
4 years agoavformat/Makefile: add missing pcm dependency to hcom demuxer
Lou Logan [Fri, 1 Nov 2019 21:57:38 +0000 (13:57 -0800)]
avformat/Makefile: add missing pcm dependency to hcom demuxer

Signed-off-by: Lou Logan <lou@lrcd.com>
Signed-off-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
4 years agoconfigure: select riffdec for act demuxer
Lou Logan [Fri, 1 Nov 2019 21:50:33 +0000 (13:50 -0800)]
configure: select riffdec for act demuxer

Signed-off-by: Lou Logan <lou@lrcd.com>
Signed-off-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
4 years agoconfigure: select jpegtables for rtp muxer
Lou Logan [Fri, 1 Nov 2019 21:35:53 +0000 (13:35 -0800)]
configure: select jpegtables for rtp muxer

Signed-off-by: Lou Logan <lou@lrcd.com>
Signed-off-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
4 years agotools/enum_options: replace the deprecated API
Zhong Li [Sat, 2 Nov 2019 15:47:01 +0000 (23:47 +0800)]
tools/enum_options: replace the deprecated API

Signed-off-by: Zhong Li <zhongli_dev@126.com>
4 years agotools/probetest: replace the deprecated API
Zhong Li [Sat, 2 Nov 2019 15:47:00 +0000 (23:47 +0800)]
tools/probetest: replace the deprecated API

Signed-off-by: Zhong Li <zhongli_dev@126.com>
4 years agolavc/qsvenc: add the missing vp9 file
zhongli_dev@126.com [Mon, 4 Nov 2019 07:11:38 +0000 (07:11 +0000)]
lavc/qsvenc: add the missing vp9 file

It is missed in commit 3358380

Signed-off-by: Zhong Li <zhongli_dev@126.com>
4 years agolavf/asfdec: Simplify the check conditions
Jun Zhao [Sat, 15 Jun 2019 08:21:56 +0000 (16:21 +0800)]
lavf/asfdec: Simplify the check conditions

Simplify the check conditions

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavf/mpegtsenc: fix logic check error
Jun Zhao [Sat, 15 Jun 2019 08:19:18 +0000 (16:19 +0800)]
lavf/mpegtsenc: fix logic check error

fix the logic check error

fix #6751

Reviewed-by: Andriy Gelman <andriy.gelman@gmail.com>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agoavformat/ftp: add AVOptions for authentication
Nicolas Frattaroli [Sat, 26 Oct 2019 22:37:32 +0000 (00:37 +0200)]
avformat/ftp: add AVOptions for authentication

This introduces two new AVOption options for the FTP protocol,
one named ftp-user to supply the username to be used for auth,
one named ftp-password to supply the password to be used for auth.

These are useful for when an API user does not wish to deal with
URL manipulation and percent encoding.

Setting them while also having credentials in the URL will use the
credentials from the URL. The rationale for this is that credentials
embedded in the URL are probably more specific to what the user is
trying to do than anything set by some API user.

Signed-off-by: Nicolas Frattaroli <ffmpeg@fratti.ch>
Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat: Add max_probe_packets option
Andriy Gelman [Thu, 17 Oct 2019 14:49:20 +0000 (10:49 -0400)]
avformat: Add max_probe_packets option

Allows user to set maximum number of buffered packets when
probing a codec. It was a hard-coded parameter before this commit.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agolavc/qsvenc: enable vp9 encoder
Zhong Li [Sat, 26 Oct 2019 14:18:31 +0000 (22:18 +0800)]
lavc/qsvenc: enable vp9 encoder

1. must enable low_power mode since just VDENC can be supported by iHD
driver right now
2. Coding option1 and extra_data are not supported by MSDK
3. IVF header will be inserted in MSDK by default, but it is not needed
for FFmpeg, so disable it.

Signed-off-by: Zhong Li <zhongli_dev@126.com>
4 years agolavc/qsvenc: Fix bitrate_limit to allow AVC encode in limited bitrate
Linjie Fu [Tue, 15 Oct 2019 07:56:23 +0000 (15:56 +0800)]
lavc/qsvenc: Fix bitrate_limit to allow AVC encode in limited bitrate

MFXVideoENCODE_Query calls CheckVideoParamQueryLike in MSDK and
will determine whether to set param.mfx.TargetKbps to the allowed
minTargetKbps according to the bitrate_limit in extco2 buffer.

Thus q->param.ExtParam must be set before MFXVideoENCODE_Query in case
minTargetKbps is written to TargetKbps by default.

1080P AVC encoding with option "-bitrate_limit 0 -b:v 100k":
Before patch:
            902 kbps
After patch:
            156 kbps
Signed-off-by: Linjie Fu <linjie.fu@intel.com>
4 years agoavcodec/v4l2_m2m: Fix indentation
Andriy Gelman [Sun, 27 Oct 2019 04:19:47 +0000 (00:19 -0400)]
avcodec/v4l2_m2m: Fix indentation

Signed-off-by: Aman Gupta <aman@tmm1.net>
4 years agoavcodec/v4l2_buffers: Fix infinite loop
Andriy Gelman [Sun, 27 Oct 2019 04:19:46 +0000 (00:19 -0400)]
avcodec/v4l2_buffers: Fix infinite loop

This part of the code counts the number of planes returned by the v4l2
device for each queried capture/output buffer.
When testing the GPU h264 encoder on Nvidia's Jetson Nano, this caused an
infinite loop because avbuf->buf.length included some empty buffers (i.e.
where avbuf->buf.m.planes[i].length = 0), meaning that the counter was
never incremented and break was never reached.
This is fixed in the commit by using a well defined iteration range.

Signed-off-by: Aman Gupta <aman@tmm1.net>
4 years agotools/target_dec_fuzzer: Adjust threshold for G2M
Michael Niedermayer [Wed, 9 Oct 2019 08:09:22 +0000 (10:09 +0200)]
tools/target_dec_fuzzer: Adjust threshold for G2M

G2M allows large images from small input and also reallocates
multiple buffers on any resolution change.

Fixes: Timeout (22sec -> 5sec)
Fixes: 18022/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_G2M_fuzzer-5089192530411520
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/aptx: Check the number of channels
Michael Niedermayer [Wed, 9 Oct 2019 07:53:26 +0000 (09:53 +0200)]
avcodec/aptx: Check the number of channels

Fixes: store to null pointer of type 'uint32_t' (aka 'unsigned int')
Fixes: 18021/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APTX_HD_fuzzer-5761738313564160
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/rv10: Check input for minimal frame size
Michael Niedermayer [Wed, 9 Oct 2019 07:08:38 +0000 (09:08 +0200)]
avcodec/rv10: Check input for minimal frame size

Fixes: Timeout (18sec -> 4sec)
Fixes: 18012/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV20_fuzzer-5767486145822720
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/aacdec_template: Check samplerate
Michael Niedermayer [Tue, 8 Oct 2019 20:52:56 +0000 (22:52 +0200)]
avcodec/aacdec_template: Check samplerate

Fixes: signed integer overflow: 2 * 1881153568 cannot be represented in type 'int'
Fixes: 17996/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5687126468853760
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/truemotion2: Fix several integer overflows in tm2_low_res_block()
Michael Niedermayer [Sat, 26 Oct 2019 19:39:41 +0000 (21:39 +0200)]
avcodec/truemotion2: Fix several integer overflows in tm2_low_res_block()

Fixes: signed integer overflow: 1077952576 + 1355863565 cannot be represented in type 'int'
Fixes: 16196/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2_fuzzer-5679842317565952
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/truemotion2: Fix several integer overflows with *Yo, *Uo, *Vo
Michael Niedermayer [Sat, 26 Oct 2019 19:34:44 +0000 (21:34 +0200)]
avcodec/truemotion2: Fix several integer overflows with *Yo, *Uo, *Vo

Fixes: signed integer overflow: 538976288 - -2080374792 cannot be represented in type 'int'
Fixes: 16196/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2_fuzzer-5144044274974720
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/utils: Check block_align
Michael Niedermayer [Thu, 31 Oct 2019 08:31:22 +0000 (09:31 +0100)]
avcodec/utils: Check block_align

Fixes: out of array access
Fixes: 18432/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAV2_fuzzer-5675574936207360
Fixes: 18326/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAV2_fuzzer-5071752362721280
Fixes: 18384/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAV1_fuzzer-5769439500304384
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>
4 years agoavfilter/vf_lut3d: simplify code
Limin Wang [Wed, 30 Oct 2019 13:20:55 +0000 (21:20 +0800)]
avfilter/vf_lut3d: simplify code

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>
4 years agoswscale/swscale_unscaled: fix gbrap10be md5 different on big endian system
Limin Wang [Wed, 30 Oct 2019 13:20:52 +0000 (21:20 +0800)]
swscale/swscale_unscaled: fix gbrap10be md5 different on big endian system

You can reproduce it by below command:
./ffmpeg -f lavfi -i "testsrc=duration=1:rate=30" -vf format=gbrap10 -vcodec rawvideo \
    -pix_fmt gbrap10le -flags +bitexact -sws_flags +accurate_rnd+bitexact -fflags +bitexact  \
    -frames:v 1 -f nut md5:

little-endian:
f91e2edd8098276579c1929e5e160416
big-endian:
ba4d011dbbdc78ccbf6cc7d698630929

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>
4 years agolibavformat/flacenc: reject too big picture blocks
Mattias Wadman [Wed, 30 Oct 2019 13:01:28 +0000 (14:01 +0100)]
libavformat/flacenc: reject too big picture blocks

A too big picture will case the muxer to write a truncated block size (uint24)
causing the output file to be corrupt.

How to reproduce:

Write a file with truncated block size:
ffmpeg -y -f lavfi -i sine -f lavfi -i color=red:size=2400x2400 -map 0:a:0 -map 1:v:0 -c:v:0 bmp -disposition:1 attached_pic -t 1 test.flac

Try to decode:
ffmpeg -i test.flac test.wav

Signed-off-by: Mattias Wadman <mattias.wadman@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/libtwolame: fix mono default bitrate
James Cowgill [Fri, 1 Nov 2019 08:51:07 +0000 (08:51 +0000)]
avcodec/libtwolame: fix mono default bitrate

As of libtwolame 0.4.0, 384 kbps is not accepted as a valid bitrate
for encoding mono audio and the maximum bitrate is now halved to 192
kbps to comply with the MP2 standard. Example error:

    twolame_init_params(): 384kbps is an invalid bitrate for mono encoding.

Adjust the default bitrate calculation to take this into account.

Signed-off-by: James Cowgill <jcowgill@debian.org>
4 years agodoc/filters: fix overlay_opencl document typo
Steven Liu [Fri, 1 Nov 2019 08:42:36 +0000 (16:42 +0800)]
doc/filters: fix overlay_opencl document typo

Reported-by: Yabo Wei <weiyabo@kuaishou.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
4 years agoavfilter/vf_median: add radiusV option
Paul B Mahol [Wed, 30 Oct 2019 09:14:23 +0000 (10:14 +0100)]
avfilter/vf_median: add radiusV option

4 years agoavfilter/af_afade: start crossfading only when first stream reached end
Paul B Mahol [Thu, 31 Oct 2019 09:22:05 +0000 (10:22 +0100)]
avfilter/af_afade: start crossfading only when first stream reached end

4 years agoavformat/hlsenc: fix the av_dirname path isn't include separator in the end of string
Limin Wang [Wed, 23 Oct 2019 15:55:15 +0000 (23:55 +0800)]
avformat/hlsenc: fix the av_dirname path isn't include separator in the end of string

Reviewed-by: Liu Steven <lq@chinaffmpeg.org>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoconfigure: fix standalone compilation of mxf muxer
Lou Logan [Wed, 30 Oct 2019 00:11:46 +0000 (16:11 -0800)]
configure: fix standalone compilation of mxf muxer

Signed-off-by: Lou Logan <lou@lrcd.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
4 years agoavformat/apngenc: Add deinit function
Andreas Rheinhardt [Wed, 23 Oct 2019 12:59:41 +0000 (14:59 +0200)]
avformat/apngenc: Add deinit function

Prevents memleaks when the trailer is never written (e.g. when there was
a write error when writing the header).

Fixes ticket #8347.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavfilter/af_afade: check for eof after crossfade later
Paul B Mahol [Wed, 30 Oct 2019 18:07:19 +0000 (19:07 +0100)]
avfilter/af_afade: check for eof after crossfade later

Fixes memleaks and #8346

4 years agoavcodec/mips: msa optimizations for vc1dsp
gxw [Mon, 21 Oct 2019 07:56:47 +0000 (15:56 +0800)]
avcodec/mips: msa optimizations for vc1dsp

Performance of WMV3 decoding has speed up from 3.66x to 5.23x tested on 3A4000.

Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/f_sidedata: fix Wtautological-constant-out-of-range-compare
Zhao Zhili [Tue, 15 Oct 2019 17:17:54 +0000 (01:17 +0800)]
avfilter/f_sidedata: fix Wtautological-constant-out-of-range-compare

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoFATE: add a test for freeezedetect
Limin Wang [Mon, 21 Oct 2019 10:12:13 +0000 (18:12 +0800)]
FATE: add a test for freeezedetect

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agodoc/filters: move drawgraph to video filters chapter
Paul B Mahol [Wed, 30 Oct 2019 16:55:44 +0000 (17:55 +0100)]
doc/filters: move drawgraph to video filters chapter

4 years agodoc/filters: move agraphmonitor to multimedia filters chapter
Paul B Mahol [Wed, 30 Oct 2019 16:47:05 +0000 (17:47 +0100)]
doc/filters: move agraphmonitor to multimedia filters chapter

4 years agoavfilter/vf_sr: correct flags since the filter changes frame w/h
Guo, Yejun [Mon, 28 Oct 2019 13:11:02 +0000 (21:11 +0800)]
avfilter/vf_sr: correct flags since the filter changes frame w/h

If filter changes frame w/h, AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
cannot be supported.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>