]> git.sesse.net Git - ffmpeg/log
ffmpeg
4 years agolavfi/af_adeclick: fix double free after ff_filter_frame fail
Jun Zhao [Mon, 19 Aug 2019 04:54:27 +0000 (12:54 +0800)]
lavfi/af_adeclick: fix double free after ff_filter_frame fail

ff_filter_frame fail will free the frame, so we just returen after this
function fail.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agoavformat/hlsenc: reindent code
Steven Liu [Tue, 20 Aug 2019 01:56:38 +0000 (09:56 +0800)]
avformat/hlsenc: reindent code

and remove redundant empty line

4 years agoavformat/hlsenc: remove unuse comment of the code
Steven Liu [Tue, 20 Aug 2019 01:45:47 +0000 (09:45 +0800)]
avformat/hlsenc: remove unuse comment of the code

4 years agolavf/hlsenc: free the old_filname to avoid memory leak
Jun Zhao [Mon, 19 Aug 2019 13:01:07 +0000 (21:01 +0800)]
lavf/hlsenc: free the old_filname to avoid memory leak

free the old_filname to avoid memory leak in error handle
path.

Reviewed-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavf/hlsenc: fix one warning: unused variable 'filename' [-Wunused-variable]
Limin Wang [Mon, 19 Aug 2019 01:42:29 +0000 (09:42 +0800)]
lavf/hlsenc: fix one warning: unused variable 'filename' [-Wunused-variable]

Reviewed-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoFATE/dnn: let fate/dnn tests depend on ffmpeg static libraries
Guo, Yejun [Wed, 7 Aug 2019 02:44:27 +0000 (10:44 +0800)]
FATE/dnn: let fate/dnn tests depend on ffmpeg static libraries

background:
DNN (deep neural network) is a sub module of libavfilter, and FATE/dnn
is unit test for the DNN module, one unit test for one dnn layer.
The unit tests are not based on the APIs exported by libavfilter,
they just directly call into the functions within DNN submodule.

There is an issue when run the following command:
build$ ../ffmpeg/configure --disable-static --enable-shared
make
make fate-dnn-layer-pad

And part of error message:
tests/dnn/dnn-layer-pad-test.o: In function `test_with_mode_symmetric':
/work/media/ffmpeg/build/src/tests/dnn/dnn-layer-pad-test.c:73: undefined reference to `dnn_execute_layer_pad'

The root cause is that function dnn_execute_layer_pad is a LOCAL symbol
in libavfilter.so, and so the linker could not find it when build dnn-layer-pad-test.
To check it, just run: readelf -s libavfilter/libavfilter.so | grep dnn

So, add dependency in fate/dnn Makefile with ffmpeg static libraries.
This is the same method used in fate/checkasm

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
4 years agolibavfilter/dnn/dnn_backend_tf: add tf.pad support for tensorflow backend with native...
Guo, Yejun [Fri, 16 Aug 2019 02:37:09 +0000 (10:37 +0800)]
libavfilter/dnn/dnn_backend_tf: add tf.pad support for tensorflow backend with native model.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
4 years agolibavfilter/dnn/dnn_backend_tf: fix typo that variable uninitialized.
Guo, Yejun [Fri, 16 Aug 2019 02:36:56 +0000 (10:36 +0800)]
libavfilter/dnn/dnn_backend_tf: fix typo that variable uninitialized.

if it is initialized randomly, the tensorflow lib will report
error message such as:
Attempt to add output -7920 of depth_to_space4 not in range [0, 1) to node with type Identity

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
4 years agoavfilter/vf_v360: add dual fisheye format
Eugene Lyapustin [Thu, 15 Aug 2019 00:56:13 +0000 (03:56 +0300)]
avfilter/vf_v360: add dual fisheye format

Signed-off-by: Eugene Lyapustin <unishifft@gmail.com>
4 years agoavfilter/vf_v360: add padding option for cubemap
Eugene Lyapustin [Thu, 15 Aug 2019 00:56:12 +0000 (03:56 +0300)]
avfilter/vf_v360: add padding option for cubemap

Signed-off-by: Eugene Lyapustin <unishifft@gmail.com>
4 years agoavfilter: add v360 filter
Eugene Lyapustin [Thu, 15 Aug 2019 00:56:11 +0000 (03:56 +0300)]
avfilter: add v360 filter

Signed-off-by: Eugene Lyapustin <unishifft@gmail.com>
4 years agoavcodec/anm: Check input size for a frame with just a stop code
Michael Niedermayer [Thu, 15 Aug 2019 19:00:54 +0000 (21:00 +0200)]
avcodec/anm: Check input size for a frame with just a stop code

Fixes: Timeout (11sec -> 6sec)
Fixes: 16344/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ANM_fuzzer-5673032000995328
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/hlsenc: merge mpegts and fmp4 workflow to one workflow
Steven Liu [Mon, 5 Aug 2019 02:24:37 +0000 (10:24 +0800)]
avformat/hlsenc: merge mpegts and fmp4 workflow to one workflow

write mpegts or fmp4 context into buffer, and flush the buffer into
output file when split fragment. merge two format split workflow into
one workflow

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
4 years agolavf/dump: use error log level for invalid size
Limin Wang [Sat, 10 Aug 2019 15:53:48 +0000 (23:53 +0800)]
lavf/dump: use error log level for invalid size

Reviewed-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavfilter/showinfo: support Content Light Level information
Limin Wang [Fri, 9 Aug 2019 02:28:02 +0000 (10:28 +0800)]
avfilter/showinfo: support Content Light Level information

show real information instead of the unknown side data type message for HDR10 stream

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavformat/avio: remove 4k limit from avio_printf
Marton Balint [Mon, 5 Aug 2019 20:27:47 +0000 (22:27 +0200)]
avformat/avio: remove 4k limit from avio_printf

We do this by switching to AVBPrint.

v2: Also set IO context error flag in case of ENOMEM.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/assenc: optimize writing dialogs
Marton Balint [Mon, 5 Aug 2019 20:36:56 +0000 (22:36 +0200)]
avformat/assenc: optimize writing dialogs

An example where the preivously added API can be useful.

Also fixes ticket #6390.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/avio: add avio_print_string_array and avio_print
Marton Balint [Mon, 5 Aug 2019 19:50:42 +0000 (21:50 +0200)]
avformat/avio: add avio_print_string_array and avio_print

These functions can be used to print a variable number of strings consecutively
to the IO context. Unlike av_bprintf, no temporary buffer is necessary.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agofate: add accurate_rnd+bitexact sws_flags for fate-gifenc
Limin Wang [Wed, 31 Jul 2019 14:26:03 +0000 (22:26 +0800)]
fate: add accurate_rnd+bitexact sws_flags for fate-gifenc

This fixes make fate issue for frame thread scale in my local testing

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavfilter/f_select: yuv will use Y plane only for scenecut detect
Limin Wang [Tue, 13 Aug 2019 01:39:47 +0000 (09:39 +0800)]
avfilter/f_select: yuv will use Y plane only for scenecut detect

At the moment scene change detection score uses all planes to detect scene
changes. In this regard this is similar how the frozen frames detection works.
However, in classic encoding scene change detection typically only uses the Y
plane.

We might get more resonable scores for scene change if we also use only
the Y plane for calculating the score if the pixel format is YUV. Although
this will require additional work once packed YUV formats are added,
because for the moment the generic scene sad score calculation has no way
to ignore some components in a packed format.

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/matroskadec: Fix seeking
Andreas Rheinhardt [Sat, 17 Aug 2019 00:27:51 +0000 (02:27 +0200)]
avformat/matroskadec: Fix seeking

matroska_reset_status (a function that is used during seeking (among
other things)) used an int for the return value of avio_seek which
returns an int64_t. Checking the return value then indicated an error
even though the seek was successfull for targets in the range of
2GB-4GB, 6GB-8GB, ... This error implied that the status hasn't been
reset and in particular, the old level was still considered to be in
force, so that ebml_parse returned errors because the newly parsed
elements were of course not contained in the previously active and still
wrongly considered active master element any more.

Addresses ticket #8084.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoconvert_from_tensorflow.py: support conv2d with dilation
Guo, Yejun [Tue, 30 Jul 2019 01:26:18 +0000 (09:26 +0800)]
convert_from_tensorflow.py: support conv2d with dilation

conv2d with dilation > 1 generates tens of nodes in graph, it is not
easy to parse each node one by one, so we do special tricks to parse
the conv2d layer.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
4 years agoconvert_from_tensorflow.py: add option to dump graph for visualization in tensorboard
Guo, Yejun [Tue, 30 Jul 2019 01:25:56 +0000 (09:25 +0800)]
convert_from_tensorflow.py: add option to dump graph for visualization in tensorboard

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
4 years agoaarch64/opusdsp: do not clobber register v8
Lynne [Thu, 15 Aug 2019 12:27:21 +0000 (13:27 +0100)]
aarch64/opusdsp: do not clobber register v8

A part of v8-v15 needs to be preserved across calls.

4 years agolibavdevice: Update the class name as uniform style
Jun Zhao [Tue, 13 Aug 2019 01:55:12 +0000 (09:55 +0800)]
libavdevice: Update the class name as uniform style

Update the class name to uniform indev/outdev style.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavf/utils: fix error like "offset 0x1f85: partial file"
tomajsjiang [Wed, 7 Aug 2019 14:48:28 +0000 (22:48 +0800)]
lavf/utils: fix error like "offset 0x1f85: partial file"

fix error like "offset 0x1f85: partial file", the root cause is when
read the mp4 file from http, and the moov in the end of the mp4 file,
reconfig the buffer will drop some data.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
Signed-off-by: Zhongxing Jiang <tomajsjiang@tencent.com>
4 years agolavf/avio: add a ffio_realloc_buf API for AVIO buffer realloc
tomajsjiang [Thu, 4 Jul 2019 03:58:41 +0000 (11:58 +0800)]
lavf/avio: add a ffio_realloc_buf API for AVIO buffer realloc

Add new API ffio_realloc_buf for AVIO buffer realloc.

Signed-off-by: Zhongxing Jiang <tomajsjiang@tencent.com>
4 years agoavcodec/libdav1d: allow setting frame size limit in pixels
James Almer [Thu, 15 Aug 2019 01:01:05 +0000 (22:01 -0300)]
avcodec/libdav1d: allow setting frame size limit in pixels

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavutil/mips: remove redundant code in TRANSPOSE16x8_UB_UB.
Shiyou Yin [Tue, 13 Aug 2019 11:13:12 +0000 (19:13 +0800)]
avutil/mips: remove redundant code in TRANSPOSE16x8_UB_UB.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/mux: Use av_packet_rescale_ts
Andreas Rheinhardt [Tue, 13 Aug 2019 02:47:19 +0000 (04:47 +0200)]
avformat/mux: Use av_packet_rescale_ts

ff_write_chained essentially duplicated the functionality of
av_packet_rescale_ts. This has been changed.

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>
4 years agoavformat/mux: Use const AVPacket * in compare functions
Andreas Rheinhardt [Tue, 13 Aug 2019 02:47:16 +0000 (04:47 +0200)]
avformat/mux: Use const AVPacket * in compare functions

There is no reason for these functions to modify the given packets at
all.

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>
4 years agoavcodec/flicvideo: Optimize and Simplify FLI_COPY in flic_decode_frame_24BPP() by...
Michael Niedermayer [Mon, 12 Aug 2019 19:17:05 +0000 (21:17 +0200)]
avcodec/flicvideo: Optimize and Simplify FLI_COPY in flic_decode_frame_24BPP() by using bytestream2_get_buffer()

Fixes: Timeout (31sec -> 22sec)
Fixes: 16217/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FLIC_fuzzer-5658084189405184
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/loco: Check left column value
Michael Niedermayer [Mon, 12 Aug 2019 19:17:04 +0000 (21:17 +0200)]
avcodec/loco: Check left column value

Fixes: Timeout (42sec -> 379 ms)
Fixes: 16323/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LOCO_fuzzer-5679178099195904
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 agotools/target_dec_fuzzer: adjust pixel threshold for MSRLE, as it allows coding gigant...
Michael Niedermayer [Mon, 12 Aug 2019 19:17:02 +0000 (21:17 +0200)]
tools/target_dec_fuzzer: adjust pixel threshold for MSRLE, as it allows coding gigantic images on tiny input

Fixes: Timeout (12sec ->2sec)
Fixes: 16125/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSRLE_fuzzer-5650846364205056
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 agofftools: Use right function signature and pointers
Andreas Rheinhardt [Tue, 6 Aug 2019 01:17:05 +0000 (03:17 +0200)]
fftools: Use right function signature and pointers

The option tables of the various fftools (in particular ffprobe) are
arrays of OptionDef; said type contains a union of a pointer to void and
a function pointer of type int (*)(void *, const char *, const char *)
as well as a size_t. Some entries (namely the common entry for writing a
report as well as several more of ffprobe's entries) used the pointer to
void to store a pointer to functions of type int (*)(const char *) or
type int (*)(const char *, const char *); nevertheless, when the functions
are actually called in write_option (in cmdutils.c), it is done via a
pointer of the first type.

There are two things wrong here:
1. Pointer to void can be converted to any pointer to incomplete or
object type and back; but they are nevertheless not completely generic
pointers: There is no provision in the C standard that guarantees their
convertibility with function pointers. C90 lacks a generic function
pointer, C99 made every function pointer a generic function pointer and
still disallows the convertibility with void *.
2. The signature of the called function differs from the signature
of the pointed-to type. This is undefined behaviour in C99 (given that
C90 lacks a way to convert function pointers at all, it doesn't say
anything about such a situation). It only works because none of the
functions this patch is about make any use of their parameters at all.

Therefore this commit changes the type of the relevant functions
to match the type used for the call and uses the union's function
pointer to store it. This is legal even in C90.

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>
4 years agoavcodec/ffwavesynth: Fixes invalid shift with pink noise seeking
Michael Niedermayer [Sat, 10 Aug 2019 21:09:45 +0000 (23:09 +0200)]
avcodec/ffwavesynth: Fixes invalid shift with pink noise seeking

Fixes: left shift of negative value -961533698048
Fixes: 16242/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFWAVESYNTH_fuzzer-5738550670131200
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/ffwavesynth: Fix integer overflow for some corner case values
Michael Niedermayer [Sat, 10 Aug 2019 21:09:44 +0000 (23:09 +0200)]
avcodec/ffwavesynth: Fix integer overflow for some corner case values

Fixes: left shift of negative value -14671840
Fixes: 16000/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFWAVESYNTH_fuzzer-5145977817661440
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/mpegtsenc: remove deprecated resend_headers option
Marton Balint [Thu, 8 Aug 2019 07:25:31 +0000 (09:25 +0200)]
avformat/mpegtsenc: remove deprecated resend_headers option

Deprecated since 2014.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/mpegtsenc: fix PCR generation intervals
Marton Balint [Sun, 4 Aug 2019 19:52:35 +0000 (21:52 +0200)]
avformat/mpegtsenc: fix PCR generation intervals

PCR generation was based on counting packets for both CBR and VBR streams.
Couting packets might have worked for CBR streams (when muxrate was specified)
but it only took into account the packets of a service (or the packets of the
PCR stream lately), so even that was problematic for multi program streams.

The new code works on actual timestamps for both CBR and VBR streams. For VBR
streams the behaviour of the old code is simulated by selecting a PCR interval
which is the highest multiple of the frame duration but still less than 100 ms.

It should be trivial to add support for setting the PCR interval for VBR
streams as well in a later patch.

The accuracy of PCR packets for CBR streams was greatly improved by preemtively
sending them at PCR intervals even if sending the payload of another stream
is in progress.

This may fix these tickets:
- #5750
- #7524

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/mpegtsenc: use increasing numbers in default service names
Marton Balint [Fri, 2 Aug 2019 21:51:57 +0000 (23:51 +0200)]
avformat/mpegtsenc: use increasing numbers in default service names

Maybe we should use service ID instead of increasing numbers?

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/mpegtsenc: remove section_write_packet forward declaration
Marton Balint [Fri, 2 Aug 2019 21:28:22 +0000 (23:28 +0200)]
avformat/mpegtsenc: remove section_write_packet forward declaration

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/mpegtsenc: factorize setting up services
Marton Balint [Fri, 2 Aug 2019 21:25:55 +0000 (23:25 +0200)]
avformat/mpegtsenc: factorize setting up services

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/mpegtsenc: fix incorrect PCR selection with multiple programs
Marton Balint [Fri, 2 Aug 2019 07:46:51 +0000 (09:46 +0200)]
avformat/mpegtsenc: fix incorrect PCR selection with multiple programs

The MPEG-TS muxer had a serious bug related to the use of multiple programs:
in that case, the PCR pid selection was incomplete for all services except one.
This patch solves this problem and selects a stream to become PCR for each
service, preferably the video stream.

This patch also moves pcr calculation attributes to MpegTSWriteStream from
MpegTSService. PCR is a per-stream and not per-service thing, so it was
misleading to refer to it as something that is per-service.

Also remove *service from MpegTSWriteStream because a stream can belong to
multiple services so it was misleading to select one for each stream.

You can check the result with this example command:

./ffmpeg -loglevel verbose -y -f lavfi -i \
  "testsrc=s=64x64:d=10,split=2[out0][tmp1];[tmp1]vflip[out1];sine=d=10,asetnsamples=1152[out2]" \
  -flags +bitexact -fflags +bitexact -sws_flags +accurate_rnd+bitexact  \
  -codec:v libx264 -codec:a mp2 -pix_fmt yuv420p \
  -map '0:v:0' \
  -map '0:v:1' \
  -map '0:a:0'  \
  -program st=0:st=2 -program st=1:st=2 -program st=2 -program st=0 -f mpegts out.ts

You should now see this:

[mpegts @ 0x37505c0] service 1 using PCR in pid=256
[mpegts @ 0x37505c0] service 2 using PCR in pid=257
[mpegts @ 0x37505c0] service 3 using PCR in pid=258
[mpegts @ 0x37505c0] service 4 using PCR in pid=256

Fixes ticket #8039.

v2: a video is stream is preferred if there are no programs, just like before
the patch.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoffplay: properly detect all window size changes
Marton Balint [Tue, 13 Aug 2019 21:05:44 +0000 (23:05 +0200)]
ffplay: properly detect all window size changes

SDL_WINDOWEVENT_SIZE_CHANGED should be used instead of SDL_WINDOWEVENT_RESIZED
because SDL_WINDOWEVENT_RESIZED is only emitted if the resize happened due to
an external event.

Fixes ticket #8072.

Additional references:
https://bugzilla.libsdl.org/show_bug.cgi?id=4760
https://wiki.libsdl.org/SDL_WindowEventID

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavfilter/vf_convolution: Fix build failures
Andreas Rheinhardt [Mon, 12 Aug 2019 01:14:55 +0000 (03:14 +0200)]
avfilter/vf_convolution: Fix build failures

98e419cb added SIMD for the convolution filter for x64 systems. As
usual, it used a check of the form
if (ARCH_X86_64)
    ff_convolution_init_x86(s);
and thereby relied on the compiler eliminating this pseudo-runtime check
at compiletime for non x64 systems (for which ff_convolution_init_x86
isn't defined) to compile. But vf_convolution.c contains more than one
filter and if the convolution filter is disabled, but one of the other
filters (prewitt, sobel, roberts) is enabled, the build will fail on x64,
because ff_convolution_init_x86 isn't defined in this case.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavcodec/indeo2: Check remaining input more often
Michael Niedermayer [Wed, 31 Jul 2019 22:50:21 +0000 (00:50 +0200)]
avcodec/indeo2: Check remaining input more often

Fixes: Timeout (95sec -> 30ms)
Fixes: 14765/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO2_fuzzer-5692455527120896
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpe
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/diracdec: Check that slices are fewer than pixels
Michael Niedermayer [Wed, 31 Jul 2019 23:49:47 +0000 (01:49 +0200)]
avcodec/diracdec: Check that slices are fewer than pixels

Fixes: Timeout (197sec ->144ms)
Fixes: 15034/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5733549405110272
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: Print max_pixels and iterations at the end
Michael Niedermayer [Wed, 31 Jul 2019 08:34:21 +0000 (10:34 +0200)]
tools/target_dec_fuzzer: Print max_pixels and iterations at the end

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agolibavfilter/vf_scale: Ensure scaled video is divisible by n
Lars Kiesow [Mon, 12 Aug 2019 13:58:14 +0000 (15:58 +0200)]
libavfilter/vf_scale: Ensure scaled video is divisible by n

This patch adds a new option to the scale filter which ensures that the
output resolution is divisible by the given integer when used together
with `force_original_aspect_ratio`. This works similar to using `-n` in
the `w` and `h` options.

This option respects the value set for `force_original_aspect_ratio`,
increasing or decreasing the resolution accordingly.

The use case for this is to set a fixed target resolution using `w` and
`h`, to use the `force_original_aspect_ratio` option to make sure that
the video always fits in the defined bounding box regardless of aspect
ratio, but to also make sure that the calculated output resolution is
divisible by n so in can be encoded with certain encoders/options if
that is required.

Signed-off-by: Lars Kiesow <lkiesow@uos.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/vp56: Consider the alpha start as end of the prior header
Michael Niedermayer [Tue, 6 Aug 2019 21:30:02 +0000 (23:30 +0200)]
avcodec/vp56: Consider the alpha start as end of the prior header

Fixes: Timeout (23sec -> 71ms)
Fixes: 15661/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP6A_fuzzer-6257865947348992
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavutil/mips: refine msa macros CLIP_*.
gxw [Wed, 7 Aug 2019 09:52:00 +0000 (17:52 +0800)]
avutil/mips: refine msa macros CLIP_*.

Changing details as following:
1. Remove the local variable 'out_m' in 'CLIP_SH' and store the result in
   source vector.
2. Refine the implementation of macro 'CLIP_SH_0_255' and 'CLIP_SW_0_255'.
   Performance of VP8 decoding has speed up about 1.1%(from 7.03x to 7.11x).
   Performance of H264 decoding has speed up about 0.5%(from 4.35x to 4.37x).
   Performance of Theora decoding has speed up about 0.7%(from 5.79x to 5.83x).
3. Remove redundant macro 'CLIP_SH/Wn_0_255_MAX_SATU' and use 'CLIP_SH/Wn_0_255'
   instead, because there are no difference in the effect of this two macros.

Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/4xm: Check for end of input in decode_p_block()
Michael Niedermayer [Mon, 12 Aug 2019 00:17:18 +0000 (02:17 +0200)]
avcodec/4xm: Check for end of input in decode_p_block()

Fixes: Timeout (81sec -> 0.2sec)
Fixes: 16169/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FOURXM_fuzzer-5662570416963584
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 agoavcodec/hevcdec: Check delta_luma_weight_l0/1
Michael Niedermayer [Mon, 12 Aug 2019 00:17:15 +0000 (02:17 +0200)]
avcodec/hevcdec: Check delta_luma_weight_l0/1

Fixes: signed integer overflow: 1 + 2147483647 cannot be represented in type 'int'
Fixes: 16041/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5685680656613376
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>
4 years agolibavformat/subfile: Fix SEEK_CUR and SEEK_END seeking
Andreas Rheinhardt [Mon, 15 Jul 2019 17:48:35 +0000 (19:48 +0200)]
libavformat/subfile: Fix SEEK_CUR and SEEK_END seeking

Up until now, when performing a SEEK_END seek, the subfile protocol
ignored the desired position (relative to EOF) and used the current
absolute offset in the input file instead.

And when performing a SEEK_CUR seek, the current position has been
ignored.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agolavf/concat: implement FFSEEK_SIZE.
Nicolas George [Fri, 19 Jul 2019 12:22:15 +0000 (14:22 +0200)]
lavf/concat: implement FFSEEK_SIZE.

4 years agolavf/aviobuf: make AVSEEK_SIZE usable from outside.
Nicolas George [Fri, 19 Jul 2019 12:21:49 +0000 (14:21 +0200)]
lavf/aviobuf: make AVSEEK_SIZE usable from outside.

4 years agotools/aviocat: add verbose mode.
Nicolas George [Fri, 19 Jul 2019 12:21:13 +0000 (14:21 +0200)]
tools/aviocat: add verbose mode.

For now: print the input size as detected by AVSEEK_SIZE.

4 years agofate: add a case for ticket #3229
Zhong Li [Mon, 12 Aug 2019 06:13:33 +0000 (14:13 +0800)]
fate: add a case for ticket #3229

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: Thilo Borgmann <thilo.borgmann@mail.de>
Signed-off-by: Zhong Li <zhong.li@intel.com>
4 years agolsws/ppc/yuv2rgb_altivec: Replace vec_lvsl/vec_perm with vec_xl
Chip Kerchner [Tue, 13 Aug 2019 00:21:24 +0000 (02:21 +0200)]
lsws/ppc/yuv2rgb_altivec: Replace vec_lvsl/vec_perm with vec_xl

gcc 6.x and 7.x generate wrong code for little endian machines
for the vec_lvsl/vec_perm instruction combos in some cases.
The bug was fixed in version 8.x
If these instructions are replaced with vec_xl, the problem goes
away for all versions of the compilers.

Fixes ticket #7124.

4 years agotools/target_dec_fuzzer: Add missing breaks
Michael Niedermayer [Mon, 12 Aug 2019 06:51:09 +0000 (08:51 +0200)]
tools/target_dec_fuzzer: Add missing breaks

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agotools/target_dec_fuzzer: Limit number off all pixels decoded
Michael Niedermayer [Wed, 31 Jul 2019 08:11:15 +0000 (10:11 +0200)]
tools/target_dec_fuzzer: Limit number off all pixels decoded

This should reduces the number of uninteresting timeouts encountered

A single threshold for all codecs did not work

Fixes: 13979/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QTRLE_fuzzer-5629872380051456 (14sec -> 4sec)
Fixes: 14709/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GDV_fuzzer-5704215281795072 (179sec -> 7sec)
Fixes: 16296/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HNM4_VIDEO_fuzzer-5756304521428992 (108sec -> 9sec)
Fixes: 15620/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GIF_fuzzer-5657214435459072 (26sec -> 26ms)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/hnm4video: Optimize postprocess_current_frame()
Michael Niedermayer [Fri, 2 Aug 2019 23:49:55 +0000 (01:49 +0200)]
avcodec/hnm4video: Optimize postprocess_current_frame()

Improves: Timeout (220sec -> 108sec)
Improves: 15570/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HNM4_VIDEO_fuzzer-5085482213441536

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoLICENSE: Add missing libraries that need --enable-version3.
Carl Eugen Hoyos [Mon, 12 Aug 2019 00:25:39 +0000 (02:25 +0200)]
LICENSE: Add missing libraries that need --enable-version3.

4 years agoLICENSE: Update list of GPLv2 libraries.
Carl Eugen Hoyos [Sun, 11 Aug 2019 23:56:21 +0000 (01:56 +0200)]
LICENSE: Update list of GPLv2 libraries.

4 years agoLICENSE: Clarify that lensfun is GPLv3+.
Carl Eugen Hoyos [Sun, 11 Aug 2019 23:50:45 +0000 (01:50 +0200)]
LICENSE: Clarify that lensfun is GPLv3+.

4 years agoLICENSE: Add missing filters licensed under the GPL.
Carl Eugen Hoyos [Sun, 11 Aug 2019 23:46:57 +0000 (01:46 +0200)]
LICENSE: Add missing filters licensed under the GPL.

4 years agoLICENSE: Remove a file that does not exist anymore.
Carl Eugen Hoyos [Sun, 11 Aug 2019 23:41:29 +0000 (01:41 +0200)]
LICENSE: Remove a file that does not exist anymore.

4 years agoLICENSE: Fix path to libswresample test file.
Carl Eugen Hoyos [Sun, 11 Aug 2019 23:32:46 +0000 (01:32 +0200)]
LICENSE: Fix path to libswresample test file.

4 years agolavc/zmbvenc: Do not left-shift negative values.
Carl Eugen Hoyos [Sun, 30 Jun 2019 23:45:36 +0000 (01:45 +0200)]
lavc/zmbvenc: Do not left-shift negative values.

Fixes the following ubsan errors with the sample from ticket #7980:
libavcodec/zmbvenc.c:243:29: runtime error: left shift of negative value -4
libavcodec/zmbvenc.c:244:28: runtime error: left shift of negative value -2

4 years agoavcodec/encode: only allow undersized audio frames if they are the last
Marton Balint [Sat, 3 Aug 2019 19:44:28 +0000 (21:44 +0200)]
avcodec/encode: only allow undersized audio frames if they are the last

Otherwise the user might get a silence padded frame in the beginning or in the
middle of the encoding.

Some other bug uncovered this:

./ffmpeg -loglevel verbose -y -f data -i /dev/zero \
-filter_complex "nullsrc=s=60x60:d=10[v0];sine=d=10[a]" \
-map '[v0]' -c:v:0 rawvideo \
-map '[a]'  -c:a:0 mp2 \
-f mpegts out.ts

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavcodec/hevc_refs: Optimize 16bit generate_missing_ref()
Michael Niedermayer [Tue, 6 Aug 2019 16:05:02 +0000 (18:05 +0200)]
avcodec/hevc_refs: Optimize 16bit generate_missing_ref()

Fixes: Timeout (86sec -> 8sec) [these numbers assume also "[FFmpeg-devel] [PATCH 2/5] [RFC] avcodec/hevcdec: Check for overread in hls_decode_entry()"]
Fixes: 15702/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5657764929470464
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/scpr: Use av_memcpy_backptr() in type 17 and 33
Michael Niedermayer [Mon, 29 Jul 2019 22:52:18 +0000 (00:52 +0200)]
avcodec/scpr: Use av_memcpy_backptr() in type 17 and 33

This makes the changed code-path faster.

Change not tested except with the fuzzer testcase as I found no other testcase.

Improves: Timeout (136sec -> 74sec)
Improves: 16040/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SCPR_fuzzer-5705876062601216

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
4 years agoavcodec/tiff: Enforce increasing offsets
Michael Niedermayer [Thu, 8 Aug 2019 23:23:46 +0000 (01:23 +0200)]
avcodec/tiff: Enforce increasing offsets

This may break some valid tiff files, it appears the specification does not require
the offsets to be increasing. They increase in the 2 test files i have though except
the last offset which is 0 (an end marker) and for which a special case is added to
avoid asking for a sample for that end marker.

See: [FFmpeg-devel] [PATCH 2/2] avcodec/tiff: Detect infinite retry loop
for an alternative implementation

Fixes: Timeout (Infinite -> Finite)
Fixes: 15706/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5114674904825856
This variant was requested by paul on IRC
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 agoavcodec/dds: Use ff_set_dimensions()
Michael Niedermayer [Sat, 10 Aug 2019 21:09:49 +0000 (23:09 +0200)]
avcodec/dds: Use ff_set_dimensions()

Fixes: signed integer overflow: 2082471995 * 36 cannot be represented in type 'int'
Fixes: 16025/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DDS_fuzzer-5136663778426880
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 agoavformat/vividas: Fix another infinite loop
Michael Niedermayer [Sat, 10 Aug 2019 21:09:47 +0000 (23:09 +0200)]
avformat/vividas: Fix another infinite loop

Not found by the fuzzer

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/vividas: Fix infinite loop in header parser
Michael Niedermayer [Sat, 10 Aug 2019 21:09:46 +0000 (23:09 +0200)]
avformat/vividas: Fix infinite loop in header parser

Fixes: Timeout (Infinite -> Finite)
Fixes: 16010/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5638616102993920
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 agoavcodec/mpc8: Fix 32bit mask/enum
Michael Niedermayer [Sat, 10 Aug 2019 21:09:42 +0000 (23:09 +0200)]
avcodec/mpc8: Fix 32bit mask/enum

Fixes: left shift of 1 by 31 places cannot be represented in type 'int'
Fixes: 15817/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPC8_fuzzer-5636626409062400
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 agoavcodec/alsdec: Fix integer overflows of raw_samples in decode_var_block_data()
Michael Niedermayer [Fri, 26 Jul 2019 13:37:30 +0000 (15:37 +0200)]
avcodec/alsdec: Fix integer overflows of raw_samples in decode_var_block_data()

This also makes the code consistent with the existing similar MUL64()
in decode_var_block_data()

Fixes: signed integer overflow: -7277630735906765035 + -3272193951413647896 cannot be represented in type 'long'
Fixes: 16015/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5666552818434048
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/alsdec: Fix integer overflow of raw_samples in decode_blocks()
Michael Niedermayer [Fri, 26 Jul 2019 12:33:14 +0000 (14:33 +0200)]
avcodec/alsdec: Fix integer overflow of raw_samples in decode_blocks()

Fixes: signed integer overflow: 2147483424 - -1772303236 cannot be represented in type 'int'
Fixes: 15708/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5067890362941440
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/alsdec: fix mantisse shift
Michael Niedermayer [Fri, 26 Jul 2019 15:07:01 +0000 (17:07 +0200)]
avcodec/alsdec: fix mantisse shift

Fixes: shift exponent -1 is negative
Fixes: 16039/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5656825657032704
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/pngdec: consider chunk size in minimal size check
Michael Niedermayer [Sun, 21 Jul 2019 22:03:15 +0000 (00:03 +0200)]
avcodec/pngdec: consider chunk size in minimal size check

assuming each block contains an empty chunk there has to be at least 8 bytes extra.

Fixes: 15327/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LSCR_fuzzer-5676669303521280
Fixes: Timeout (11->5sec)
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: Fix invalid shifts in vc1_decode_i_blocks()
Michael Niedermayer [Sat, 22 Jun 2019 12:21:43 +0000 (14:21 +0200)]
avcodec/vc1_block: Fix invalid shifts in vc1_decode_i_blocks()

Fixes: left shift of negative value -9
Fixes: 15299/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSS2_fuzzer-5660922678345728
Fixes: 15557/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5673351911047168
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: fix invalid shift in vc1_decode_p_mb()
Michael Niedermayer [Sat, 22 Jun 2019 10:35:24 +0000 (12:35 +0200)]
avcodec/vc1_block: fix invalid shift in vc1_decode_p_mb()

Fixes: left shift of negative value -5
Fixes: 15294/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1_fuzzer-5733921754447872
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: fix integer overflow in imdct_and_windowing()
Michael Niedermayer [Tue, 9 Jul 2019 22:04:02 +0000 (00:04 +0200)]
avcodec/aacdec_template: fix integer overflow in imdct_and_windowing()

Fixes: signed integer overflow: 2147483645 + 4 cannot be represented in type 'int'
Fixes: 15418/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5685269069561856
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 agolavc/videotoolboxenc: make transfer_fnc initialized for unsupport function
Limin Wang [Wed, 17 Jul 2019 22:59:35 +0000 (06:59 +0800)]
lavc/videotoolboxenc: make transfer_fnc initialized for unsupport function

The current function will report one error message, but the caller func
haven't check it, so change the default to process as AVCOL_TRC_UNSPECIFIED.

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Rick Kern <kernrj@gmail.com>
4 years agolavc/videotoolboxenc: add hdr10, linear, hlg color transfer function for videotoolboxenc
Limin Wang [Wed, 26 Jun 2019 10:57:59 +0000 (18:57 +0800)]
lavc/videotoolboxenc: add hdr10, linear, hlg color transfer function for videotoolboxenc

Below is the testing ffmpeg command for the setting:
./ffmpeg -i input.ts -c:v hevc_videotoolbox -color_primaries bt2020 -colorspace bt2020_ncl -color_trc smpte2084 smpte2048.ts
./ffmpeg -i input.ts -c:v hevc_videotoolbox -color_primaries bt2020 -colorspace bt2020_ncl -color_trc linear linear.ts
./ffmpeg -i input.ts -c:v hevc_videotoolbox -color_primaries bt2020 -colorspace bt2020_ncl -color_trc arib-std-b67 hlg.ts

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Rick Kern <kernrj@gmail.com>
4 years agoMAINTAINERS: Add my GnuPG fingerprint.
Thilo Borgmann [Sun, 11 Aug 2019 10:08:15 +0000 (12:08 +0200)]
MAINTAINERS: Add my GnuPG fingerprint.

4 years agolavc/r210enc: Fix undefined behaviour encoding r10k.
Carl Eugen Hoyos [Mon, 1 Jul 2019 11:06:02 +0000 (13:06 +0200)]
lavc/r210enc: Fix undefined behaviour encoding r10k.

Fixes the following ubsan error:
libavcodec/r210enc.c:69:28: runtime error: left shift of 522 by 22 places cannot be represented in type 'int'

Fixes ticket #7982.

4 years agolavc/vc2enc_dwt: Avoid left-shifting a negative value.
Carl Eugen Hoyos [Tue, 2 Jul 2019 09:38:14 +0000 (11:38 +0200)]
lavc/vc2enc_dwt: Avoid left-shifting a negative value.

Fixes ticket #7985.

4 years agolavc/frame_thread_encoder: Do not memcpy() from NULL.
Carl Eugen Hoyos [Tue, 2 Jul 2019 09:42:32 +0000 (11:42 +0200)]
lavc/frame_thread_encoder: Do not memcpy() from NULL.

Fixes ticket #7981.

4 years agolavc/libx264: Cast cpb bit_rates to int64_t to avoid an integer overflow.
Carl Eugen Hoyos [Sat, 10 Aug 2019 21:52:59 +0000 (23:52 +0200)]
lavc/libx264: Cast cpb bit_rates to int64_t to avoid an integer overflow.

Fixes remaining part of ticket #8071 on next version bump.

4 years agolavf/dump: Fix cpb bitrate type after next major bump.
Carl Eugen Hoyos [Sat, 10 Aug 2019 12:43:58 +0000 (14:43 +0200)]
lavf/dump: Fix cpb bitrate type after next major bump.

4 years agolavf/dump: Fix vbv_delay type specifier.
Carl Eugen Hoyos [Sat, 10 Aug 2019 21:33:10 +0000 (23:33 +0200)]
lavf/dump: Fix vbv_delay type specifier.

Spotted-by: James Almer
4 years agolavc/libx264: Cast bit_rate to int64_t to avoid an integer overflow.
Carl Eugen Hoyos [Sat, 10 Aug 2019 15:10:58 +0000 (17:10 +0200)]
lavc/libx264: Cast bit_rate to int64_t to avoid an integer overflow.

Fixes ticket #8071.

4 years agolavc/libx264: bit_rates > INT_MAX are not supported.
Carl Eugen Hoyos [Sat, 10 Aug 2019 12:40:23 +0000 (14:40 +0200)]
lavc/libx264: bit_rates > INT_MAX are not supported.

4 years agoavformat/rtpdec_mpeg4: Fix integer parameters size check in SDP fmtp line
Olivier Maignial [Wed, 24 Jul 2019 08:20:14 +0000 (10:20 +0200)]
avformat/rtpdec_mpeg4: Fix integer parameters size check in SDP fmtp line

=== PROBLEM ===

I was trying to record h264 + aac streams from an RTSP server to mp4 file. using this command line:
    ffmpeg -v verbose -y -i "rtsp://<ip>/my_resources" -codec copy -bsf:a aac_adtstoasc test.mp4

FFmpeg then fail to record audio and output this logs:
    [rtsp @ 0xcda1f0] The profile-level-id field size is invalid (40)
    [rtsp @ 0xcda1f0] Error parsing AU headers
    ...
    [rtsp @ 0xcda1f0] Could not find codec parameters for stream 1 (Audio: aac, 48000 Hz, 1 channels): unspecified sample format

In SDP provided by my RTSP server I had this fmtp line:
    a=fmtp:98 streamType=5; profile-level-id=40; mode=AAC-hbr; config=1188; sizeLength=13; indexLength=3; indexDeltaLength=3;

In FFmpeg code, I found a check introduced by commit 24130234cd9dd733116d17b724ea4c8e12ce097a. It disallows values greater than 32 for fmtp line parameters.
RFC-4566 (SDP: Session Description Protocol) do not give any limit of size on interger parameters given in an fmtp line.

However, In RFC-6416 (RTP Payload Format for MPEG-4 Audio/Visual Streams) give examples of "profile-level-id" values for AAC, up to 55.

=== FIX ===

As each parameter may have its own min and max values
I propose to introduce a range for each parameter.
For this patch I used RFC-3640 and ISO/IEC 14496-1 as reference for validity ranges.

This patch fix my problem and I now can record my RTSP AAC stream to mp4.
It has passed the full fate tests suite sucessfully.

Signed-off-by: Olivier Maignial <olivier.maignial@smile.fr>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agotools/zmqsend: Avoid mem copy past the end of input buffer
Andriy Gelman [Thu, 8 Aug 2019 14:37:10 +0000 (10:37 -0400)]
tools/zmqsend: Avoid mem copy past the end of input buffer

This patch avoids a read past the end of the input buffer in memcpy since the size
of the received zmq message is recv_buf_size - 1.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agodoc/fate: Document how to request samples upload access
Michael Niedermayer [Wed, 7 Aug 2019 19:18:12 +0000 (21:18 +0200)]
doc/fate: Document how to request samples upload access

The awnser which most people will seek is put first

Reviewed-by: Thilo Borgmann <thilo.borgmann@mail.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agodoc/ffmpeg: Document dts_error_threshold option
Jun Zhao [Sun, 21 Jul 2019 04:36:21 +0000 (12:36 +0800)]
doc/ffmpeg: Document dts_error_threshold option

Document dts_error_threshold option.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agoexamples/encode_video: only add sequence end code for mpeg1/2 video
Jun Zhao [Mon, 5 Aug 2019 04:53:55 +0000 (12:53 +0800)]
examples/encode_video: only add sequence end code for mpeg1/2 video

Only add sequence end code for mpeg1/mpeg2 video, or else use the encoder
libx264 or libx265 in this sample, decoding the output file will get
unknow NALU type error.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>