1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

95837 Commits

Author SHA1 Message Date
Michael Niedermayer
0c3e1b395b 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>
2019-11-09 15:57:34 +01:00
Michael Niedermayer
03ea8d8cd4 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>
2019-11-09 15:57:33 +01:00
Michael Niedermayer
2a8785966c 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>
2019-11-09 15:31:06 +01:00
Michael Niedermayer
947732c56d 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>
2019-11-09 15:25:32 +01:00
Michael Niedermayer
de1d3b0925 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>
2019-11-09 15:23:06 +01:00
Michael Niedermayer
07519f363b 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>
2019-11-09 15:20:30 +01:00
Michael Niedermayer
859362a6f0 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>
2019-11-09 14:13:34 +01:00
Michael Niedermayer
114ddf6430 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>
2019-11-09 13:46:21 +01:00
Michael Niedermayer
55279d699f avcodec/snowenc: Set mb_num to avoid ratecontrol floating point divisions by 0.0
Fixes: Ticket7990

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-11-09 13:46:20 +01:00
Michael Niedermayer
8802e329c8 avcodec/snowenc: Fix 2 undefined shifts
Fixes: Ticket7990

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-11-09 13:46:19 +01:00
Steven Liu
bb190ded67 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>
2019-11-09 11:27:14 +09:00
James Zern
a605e9ad1e avcodec/libvpxenc,cosmetics: fix a typo
predicition -> prediction
2019-11-08 17:48:29 -08:00
James Zern
a6be42a733 avcodec/libvpxdec.c,cosmetics: bpp -> bpc
Signed-off-by: James Zern <jzern@google.com>
2019-11-08 17:42:42 -08:00
Lou Logan
007e03348d avfilter/Makefile: add missing framesync dependency to bm3d & mix filters
Signed-off-by: Lou Logan <lou@lrcd.com>
2019-11-08 09:37:31 -09:00
Lou Logan
5896411437 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>
2019-11-08 09:37:31 -09:00
leozhang
c79307b7de avfilter/vf_dnn_processing: correct duplicate statement
Signed-off-by: leozhang <leozhang@qiyi.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-11-08 14:57:01 +01:00
Guo, Yejun
f6e942251c avfilter/vf_dnn_processing: fix fate-source
Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-11-08 14:56:38 +01:00
Michael Niedermayer
9802599ad0 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>
2019-11-08 14:48:01 +01:00
Limin Wang
81271b3cce avfilter/f_metadata: remove unneeded code
Reviewed-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2019-11-08 22:25:10 +09:00
Jun Zhao
e700038990 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>
2019-11-08 11:39:02 +08:00
Jun Zhao
a23c8d75ec 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>
2019-11-08 11:39:02 +08:00
Jun Zhao
5307c12acb 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>
2019-11-08 11:39:02 +08:00
Jun Zhao
d44c7235a8 lavf/flvenc: Cosmetics: fix indentation
fix indentation

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-11-08 11:39:02 +08:00
Jun Zhao
3dce89e55e 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>
2019-11-08 11:39:02 +08:00
Jun Zhao
bbf061c7ca 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>
2019-11-08 11:39:02 +08:00
Guo, Yejun
4d980a8ceb 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>
2019-11-07 15:46:00 -03:00
Andreas Rheinhardt
fc7b6d5574 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>
2019-11-06 20:38:03 +01:00
leozhang
84c27c8c08 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>
2019-11-06 20:38:03 +01:00
Andriy Gelman
7b2ce27e56 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>
2019-11-06 20:38:03 +01:00
Lou Logan
a0c7406075 avcodec/Makefile: add missing msmpeg4* dependencies to wmv1 encoder
Signed-off-by: Lou Logan <lou@lrcd.com>
2019-11-06 09:49:59 -09:00
Lou Logan
b973d27952 avcodec/Makefile: add missing h263data dependency to snow encoder
Signed-off-by: Lou Logan <lou@lrcd.com>
2019-11-06 09:49:59 -09:00
Lou Logan
9022a5e0c2 avcodec/Makefile: add missing vorbis_data dependency to opus encoder
Signed-off-by: Lou Logan <lou@lrcd.com>
2019-11-06 09:49:59 -09:00
Lou Logan
0663f0e0da configure: select mdct for dca encoder
Signed-off-by: Lou Logan <lou@lrcd.com>
2019-11-06 09:49:59 -09:00
Baptiste Coudurier
004ebd4b37 avcodec/dvdec: correctly decode bottom mb row in 1080i field mode 2019-11-06 08:40:36 -08:00
Baptiste Coudurier
33203a08e0 avcodec/dvdec: correctly set interlaced and tff 2019-11-06 08:40:08 -08:00
Marton Balint
c54268ce02 avcodec/libvpxdec: reject video and alpha dimension mismatches
Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: James Zern <jzern@google.com>
2019-11-05 23:14:24 -08:00
Marton Balint
5478e2cc57 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>
2019-11-05 23:14:24 -08:00
Marton Balint
98aa1eb1cb 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>
2019-11-05 23:14:24 -08:00
Marton Balint
99e0007046 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>
2019-11-05 23:14:24 -08:00
Marton Balint
6b54477072 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>
2019-11-05 23:14:24 -08:00
Marton Balint
4255032914 avcodec/libvpxenc: fix alpha stride
Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: James Zern <jzern@google.com>
2019-11-05 23:14:24 -08:00
Michael Niedermayer
e4fdeb3fce 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>
2019-11-05 21:21:59 +01:00
Limin Wang
377fa6612a 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>
2019-11-05 21:21:32 +01:00
Lou Logan
121326d7b8 configure: select bswapdsp for ylc decoder
Signed-off-by: Lou Logan <lou@lrcd.com>
2019-11-05 09:40:27 -09:00
Lou Logan
c69ade947a configure: select fft for qdmc decoder
Signed-off-by: Lou Logan <lou@lrcd.com>
2019-11-05 09:40:27 -09:00
Lou Logan
16503a933d configure: select bswapdsp for mdec decoder
Signed-off-by: Lou Logan <lou@lrcd.com>
2019-11-05 09:40:08 -09:00
Lou Logan
04e23e027e configure: select bswapdsp for imm4 decoder
Signed-off-by: Lou Logan <lou@lrcd.com>
2019-11-05 09:38:52 -09:00
Lou Logan
3bfd12d84c avcodec/Makefile: add missing ass dependency to ccaption decoder
Signed-off-by: Lou Logan <lou@lrcd.com>
2019-11-04 14:12:24 -09:00
Lou Logan
1c7e661adb configure: select audiodsp for acelp_kelvin decoder
Signed-off-by: Lou Logan <lou@lrcd.com>
2019-11-04 14:10:11 -09:00
Lou Logan
e8e788da97 configure: select mdct for atrac3al decoder
Signed-off-by: Lou Logan <lou@lrcd.com>
2019-11-04 14:06:22 -09:00