Commit Graph

96179 Commits

Author SHA1 Message Date
Michael Niedermayer d5e7f01090 avfilter/vf_geq: Relicense to LGPL
All authors who have code in this under GPL agreed.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-12-28 11:20:48 +01:00
Michael Niedermayer 18ff210efb avcodec/atrac9dec: Clamp band_ext_data to max that can be read if skipped.
Fixes: out of array read
Fixes: 19327/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ATRAC9_fuzzer-5679823087468544

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-12-28 11:20:48 +01:00
Michael Niedermayer 1f20969457 avcodec/agm: Include block size in the MV check for flags == 3
Fixes: out of array read
Fixes: 19331/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AGM_fuzzer-5644115983466496

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-12-28 11:20:48 +01:00
Michael Niedermayer bf5c850b79 avcodec/wmadec: Keep track of exponent initialization per channel
Fixes: division by 0
Fixes: 19123/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAV2_fuzzer-5655493121146880

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-12-28 11:20:48 +01:00
Michael Niedermayer f1b97f62f8 avcodec/iff: Check that video_size is large enough for the read parameters
video is allocated before parameters like bpp are read.

Fixes: out of array access
Fixes: 19084/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5718556033679360
Fixes: 19465/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5759908398235648

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-12-28 11:20:48 +01:00
Andriy Gelman fc3760a66d avcodec/v4l2_m2m_enc: Check encoder pix_fmt matches pix_fmt on device
Fixes #8079

During initialization of a v4l2m2m device, the configured pix_fmt can be
different to the pix_fmt of the encoder (i.e. avctx->pix_fmt).

For example on the Odroid XU4:
./ffmpeg -f lavfi -i yuvtestsrc -codec:v h264_v4l2m2m out.h264

will configure the v4l2 encoder to pix_fmt nv21, whereas the input
frames will be yuv444p.

This commit checks that the configured v4l2 pix_fmt on device is the
same as avctx->pix_fmt. If they are different the initialization fails
and an error is returned. Tested on RPI4 and Odroid XU4.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2019-12-27 23:42:57 +00:00
Marton Balint a619787a9c avutil/tests/opt: add av_opt_get/av_opt_set tests
Signed-off-by: Marton Balint <cus@passwd.hu>
2019-12-27 21:52:21 +01:00
Marton Balint 672b925e8a avutil/tests/opt: add tests for AV_OPT_TYPE_DICT
Signed-off-by: Marton Balint <cus@passwd.hu>
2019-12-27 21:52:21 +01:00
Marton Balint 5edacc4609 avutil/opt: add full support for AV_OPT_TYPE_DICT
Now it is possible to set them from a string, to serialize them and to use a
default value.

Signed-off-by: Marton Balint <cus@passwd.hu>
2019-12-27 21:52:21 +01:00
Paul B Mahol 6c883e214a avfilter/vf_vibrance: add support for commands 2019-12-27 21:31:04 +01:00
Paul B Mahol 50cfe9662d avfilter/vf_il: add support for commands 2019-12-27 21:17:00 +01:00
Paul B Mahol 5fb37598ad avfilter/af_stereowiden: add support for commands 2019-12-27 21:03:29 +01:00
Paul B Mahol 954637805d avfilter/af_extrastereo: add support for commands 2019-12-27 20:57:06 +01:00
Paul B Mahol fad62eebee avfilter/vf_neighbor: add support for commands 2019-12-27 20:21:20 +01:00
Marvin Scholz f37bfd3f62 avformat/dashdec: propagate icy to child AVIOContexts
When the user decides they do not want to to send the Icy-MetaData
header, this should be respected for all requests, not just the first
one.

Fix #5578

Reviewed-by: Liu Steven <lq@chinaffmpeg.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-12-27 14:58:51 -03:00
Marvin Scholz c3bb6efef2 avformat/hls: propagate icy to child AVIOContexts
When the user decides they do not want to to send the Icy-MetaData
header, this should be respected for all requests, not just the first
one.

Fix #5578

Reviewed-by: Liu Steven <lq@chinaffmpeg.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-12-27 14:57:25 -03:00
Limin Wang 93671d6755 avcodec/mvha: fix warning: variable 'size' set but not used
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-12-27 13:13:39 -03:00
Andreas Rheinhardt 39561bbe77 avformat/microdvdenc: Use avio_w8 to write a char
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-12-27 12:38:08 +01:00
Andreas Rheinhardt 9bde6c6be0 avformat/microdvd: Use \n instead of \0 to end file header
Up until now, the microdvd demuxer uses av_strdup() to allocate the
extradata from a string; its length is set to strlen() + 1, i.e.
including the \0 at the end. Upon remuxing, the muxer would simply copy
the extradata at the beginning, including the \0.

This commit changes this by not adding the \0 to the size of the
extradata; the muxer now delimits extradata by inserting a \n. This
required to change the subtitles-microdvd-remux FATE-test.

Furthermore, the extradata is now allocated with zeroed padding.

The microdvd decoder is not affected by this, as it didn't use the size
of the extradata at all, but treated it as a C-string.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-12-27 12:38:08 +01:00
Andreas Rheinhardt b0d0d7e4d0 avformat/flvenc: Fix leak of oversized packets
Might happen for annex B H.264.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-12-26 22:48:44 +01:00
Andreas Rheinhardt 28d02524a0 avformat/flvenc: Forward errors from allocating keyframe index
While the function adding a new element to the keyframe index checked
the allocation, the caller didn't check the return value. This has been
changed. To do so, the return value has been changed to an ordinary ret
instead of pb->error. This doesn't pose a problem, as write_packet() in
mux.c already checks for write errors (since 9ad1e0c1).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-12-26 22:48:44 +01:00
Andreas Rheinhardt a94e6b50c6 avformat/wavenc: Add deinit function
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-12-26 22:48:44 +01:00
Andreas Rheinhardt 827bdc8418 avformat/spdifenc: Replace write_trailer by deinit
The write_trailer function doesn't write anything anyway. It only frees
memory.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-12-26 22:22:33 +01:00
Limin Wang ef91e3955a avcodec/vc1dec: remove the unneeded ()
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-12-26 22:22:33 +01:00
Limin Wang f8f86f8356 avcodec/ass: remove the unneeded ()
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-12-26 22:22:33 +01:00
Paul B Mahol b5f0cea16c avfilter/vf_histogram: use the name 's' for the pointer to the private context
This is consistent across filters.
2019-12-26 20:45:20 +01:00
Michael Niedermayer 4fa2d5a692 avcodec/cbs_vp9: Check data_size
Fixes: out of array access
Fixes: 19542/clusterfuzz-testcase-minimized-ffmpeg_BSF_TRACE_HEADERS_fuzzer-5659498341728256

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-12-26 16:06:25 +01:00
Andreas Rheinhardt 398a5f5d8f avfilter/buffersrc: Remove unused variables
Unused since f09ae730.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-12-26 16:06:25 +01:00
Marton Balint c991e9cd91 avdevice/xcbgrab: use a buffer pool for shared memory segments
Also by wrapping the SHM buffer in an AVBufferRef we eliminate yet another
possible memcpy improving performance.

Signed-off-by: Marton Balint <cus@passwd.hu>
2019-12-26 00:47:24 +01:00
Marton Balint 16685114d5 avutil/buffer: add av_buffer_pool_buffer_get_opaque
In order to access the original opaque parameter of a buffer in the buffer
pool. (The buffer pool implementation overrides the normal opaque parameter but
also saves it so it is accessible).

v2: add assertion check before dereferencing the BufferPoolEntry.

Signed-off-by: Marton Balint <cus@passwd.hu>
2019-12-26 00:47:24 +01:00
Paul B Mahol e3dca0744d avformat/dhav: improve seeking 2019-12-25 22:10:47 +01:00
Michael Niedermayer d6553e2e60 avcodec/cbs_vp9: Check index_size
Fixes: out of array read
Fixes: 19300/clusterfuzz-testcase-minimized-ffmpeg_BSF_VP9_METADATA_fuzzer-5653911730126848

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-12-25 18:00:40 +01:00
Limin Wang 3dd6c4478b avfilter/vf_yadif: cosmetics in the pix_fmts[] array
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-12-25 18:00:40 +01:00
Gyan Doshi 287620f59c avfilter/drawtext: log why input pad failed to be configured 2019-12-24 11:04:52 +05:30
Paul B Mahol a13af9aee1 avformat/sccdec: only change duration for last subtitle 2019-12-23 22:47:27 +01:00
Paul B Mahol 13bffa7969 avformat/sccdec: fix sub->pos values 2019-12-23 22:39:46 +01:00
Paul B Mahol 9da7536ce2 avformat/sccdec: fix timestamp of last subtitle
Fixes -c:s copy case.
2019-12-23 22:16:25 +01:00
Paul B Mahol 547b0c61af avfilter/vf_fade: reindent after previous commit 2019-12-23 20:24:36 +01:00
Paul B Mahol 6c9a9dd25a avfilter/vf_fade: add support for gbrp/gbrap formats 2019-12-23 20:16:27 +01:00
Zhong Li 5dc527f9ca lavc/midivid: check return value of init_get_bits8()
Fix CID 1456088

Signed-off-by: Zhong Li <zhongli_dev@126.com>
2019-12-23 20:14:42 +01:00
Paul B Mahol 94ad5d0128 avfilter/vf_readeia608: factor some constants out 2019-12-23 20:09:20 +01:00
Paul B Mahol 94682555c6 avfilter/vf_readeia608: check if gaps between clock bits are big enough
Should help finding less false positives.
2019-12-23 19:56:05 +01:00
Paul B Mahol 16968b619d avfilter/vf_readeia608: use special struct to hold line items 2019-12-23 18:02:38 +01:00
Zhao Zhili 0115dbd043 avfilter/avfilter: update documentation of avfilter_graph_create_filter 2019-12-23 17:02:55 +01:00
Zhao Zhili 61097535cd avfilter/buffersink: deprecate AVBufferSinkParams and AVABufferSinkParams 2019-12-23 17:02:55 +01:00
Zhao Zhili 07ffdedf78 avfilter/buffersink: replace init_opaque by init
The argument 'opaque' is always NULL since 0acf7e2 (2013),
and avfilter_init_filter() was removed in 52067b3c0e (2016).
2019-12-23 17:02:55 +01:00
Zhao Zhili 807e90d232 avfilter/buffersink: remove unused macros 2019-12-23 17:02:55 +01:00
Zhao Zhili bf08264daa avfilter/buffersrc: remove redundant flag
!(c->pix_fmt != AV_PIX_FMT_NONE || c->got_format_from_params)

equals

(c->pix_fmt == AV_PIX_FMT_NONE) && !c->got_format_from_params

1. When (c->pix_fmt == AV_PIX_FMT_NONE) is true, got_format_from_params is
always false, the flag doesn't contribute to the result.

2. When the first part is false, the second part doesn't matter, the flag
doesn't contribute to the result.

The result only depends on c->pix_fmt.
2019-12-23 17:02:55 +01:00
Gyan Doshi f0b3b55002 avformat/mpegtsenc: warn users if codec isn't supported
The MPEG-TS muxer will mux streams with unsupported codec id
as a private data stream; this usually makes the stream
not recognizable by ffmpeg and likely other tools.
2019-12-23 21:06:37 +05:30
James Almer c75f246a3c avcodec/noise_bsf: remove superfluous fail label
Signed-off-by: James Almer <jamrial@gmail.com>
2019-12-23 11:49:44 -03:00