Commit Graph

95337 Commits

Author SHA1 Message Date
Paul B Mahol c303d0979f avfilter/vf_normalize: typedef all structs 2019-10-07 12:17:14 +02:00
Paul B Mahol 651a0f6308 avfilter/vf_showpalette: remove timeline flag
This filter changes output size and thus can not have support
for timeline.
2019-10-07 12:07:00 +02:00
Paul B Mahol 0c4137bcb7 avfilter/af_afftfilt: fix possible invalid memory access 2019-10-07 11:37:05 +02:00
Paul B Mahol 5b4010e886 avfilter/vf_nnedi: fix possible double free 2019-10-07 11:15:44 +02:00
Paul B Mahol a1e5c35a6e doc/filters: fix few more typos 2019-10-06 20:32:16 +02:00
Michael Niedermayer 81b53913bb avformat/subtitles: Check nb_subs in ff_subtitles_queue_finalize()
Fixes: null pointer dereference
Fixes: 17828/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5645915116797952
Fixes: Ticket8147

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-10-06 20:00:59 +02:00
Michael Niedermayer 22bec0d33f avcodec/h2645_parse: Use av_fast_realloc() for nals array
Fixes: Timeout (17sec ->281ms)
Fixes: 17833/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-5638346914660352

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-10-06 20:00:59 +02:00
Andreas Rheinhardt e3650dcfc9 avcodec/cinepakenc: Fix invalid shifts
Fixes: left shift of 1 by 31 places cannot be represented in type 'int'.
Affected the FATE-tests vsynth1-cinepak, vsynth2-cinepak and
vsynth_lena-cinepak. Also fixes ticket #8220.

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-10-06 20:00:59 +02:00
Andreas Rheinhardt 670fd3b0ec avformat/mpjpegdec: Avoid allocation of AVIOContext
Put an AVIOContext whose lifetime doesn't extend beyond the function where
it is allocated on the stack instead of allocating and freeing it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-10-06 20:00:59 +02:00
James Almer 5f758c31f9 avformat/matroskaenc: use r_frame_rate as fallback to set a track's DefaultDuration
Signed-off-by: James Almer <jamrial@gmail.com>
2019-10-06 13:44:52 -03:00
Paul B Mahol 66d45af13c avfilter/vf_avgblur: add support for commands 2019-10-06 15:46:06 +02:00
Paul B Mahol da9337c911 avfilter/vf_gblur: add support for commands 2019-10-06 15:34:28 +02:00
Paul B Mahol e37edc70bd avfilter: add anlms filter 2019-10-06 15:09:38 +02:00
Jun Zhao a27c0781dd doc/codecs: Update documentation for flags/flags2
Update documentation for flags/flags2

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-10-06 17:33:00 +08:00
Jun Zhao d9bb12ee39 lavc/options_table: Correct the flags for AVCodecContext.flags2
Correct the flags for AVCodecContext.flags2.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-10-06 17:31:59 +08:00
Jun Zhao b0e6822448 avcodec/decode: fix indentation
fix indentation.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: Gyan Doshi <ffmpeg@gyani.pro>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-10-06 17:29:11 +08:00
Mengye Lv 9f353e376b avutil/common: Fix underflow for ROUNDED_DIV with unsigned integer
When used ROUNDED_DIV(a,b), if a is unsigned integer zero, it's
will lead to an underflow issue(it called unsigned integer
wrapping).

Fixes #8062

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Mengye Lv <mengyelv@tencent.com>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-10-06 17:28:29 +08:00
James Almer 3b4e9a31ea avformat/matroskadec: don't rescale mastering display values
Simplifies code.

Signed-off-by: James Almer <jamrial@gmail.com>
2019-10-05 22:37:41 -03:00
Paul B Mahol 7da57875b5 avformat/mpeg: better fix for MLP versus PCM-DVD misdetection 2019-10-05 11:15:42 +02:00
Zhao Zhili 7c145b6441 FATE/dnn: fix stack buffer overflow
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
2019-10-04 09:58:22 -03:00
Daniel Kolesa e6625ca41f swscale: Fix AltiVec/VSX build with recent GCC
The argument to vec_splat_u16 must be a literal. By making the
function always inline and marking the arguments const, gcc can
turn those into literals, and avoid build errors like:

swscale_vsx.c:165:53: error: argument 1 must be a 5-bit signed literal

Fixes #7861.

Signed-off-by: Daniel Kolesa <daniel@octaforge.org>
Signed-off-by: Lauri Kasanen <cand@gmx.com>
2019-10-04 08:58:17 +03:00
Daniel Kolesa 1bdb47b734 swscale: Replace illegal vector keyword usage in altivec code
While this technically compiles in current ffmpeg, this is only
because ffmpeg is compiled in strict ISO C mode, which disables
the builtin 'vector' keyword for AltiVec/VSX. Instead this gets
replaced with a macro inside altivec.h, which defines vector to
be actually __vector, which accepts random types.

Normally, the vector keyword should be used only with plain
scalar non-typedef types, such as unsigned int. But we have the
vec_(s|u)(8|16|32) macros, which can be used in a portable manner,
in util_altivec.h in libavutil.

This is also consistent with other AltiVec/VSX code elsewhere in
the tree.

Fixes #7861.

Signed-off-by: Daniel Kolesa <daniel@octaforge.org>
Signed-off-by: Lauri Kasanen <cand@gmx.com>
2019-10-04 08:58:17 +03:00
Andreas Rheinhardt 581419ea39 avformat/matroskadec: Fix demuxing ProRes
The structure of a ProRes frame in mov/mp4 is that of a typical atom:
First a 32 bit BE size field, then a tag detailling the content. Said
size field includes the eight bytes of the atom header.

This header is actually redundant, as the size of the atom is already
known from the containing atom. It is therefore stripped away when muxed
into Matroska and so the Matroska demuxer has to recreate upon demuxing.
But it did not account for the fact that the size field includes the
size of the header and this can lead to problems when a decoder uses the
in-band size field.

Fixes ticket #8210.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-10-04 00:06:30 -03:00
Michael Niedermayer 379e5d29d5 avcodec/tiff: Set FF_CODEC_CAP_INIT_CLEANUP
Fixes: memleaks
Fixes: 17813/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5145600206569472

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>
2019-10-03 19:37:35 +02:00
Michael Niedermayer 2f588ccfb7 avcodec/vc1_block: Fix invalid left shift in vc1_decode_p_mb()
Fixes: left shift of negative value -6
Fixes: 17810/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1_fuzzer-5638541240958976

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>
2019-10-03 19:37:28 +02:00
Michael Niedermayer 9b533de28e avcodec/wmaprodec: Check if there is a stream
Fixes: null pointer dereference
Fixes: signed integer overflow: 512 * 2147483647 cannot be represented in type 'int'
Fixes: 17809/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XMA1_fuzzer-5634409947987968

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>
2019-10-03 19:37:10 +02:00
Andreas Rheinhardt be0d3a2df1 avformat/aiffenc: Remove wrong and redundant check
The check "if (!pb->seekable & AVIO_SEEKABLE_NORMAL)" is wrong, because
! has higher precendence than &. But it is also redundant, because this
part of the code is only ever reached when the AVIO_SEEKABLE_NORMAL flag
is set for pb. So simply remove the check.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Matthieu Bouron <matthieu.bouron@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-10-03 19:34:23 +02:00
Andreas Rheinhardt c694fc5759 avformat/aiffenc: Fix potential memleak upon failure
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Matthieu Bouron <matthieu.bouron@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-10-03 19:34:23 +02:00
Andreas Rheinhardt c548b0a4c6 avformat/aiffenc: Use standard packet list functions
Up until now, aiffenc didn't rely on the standard functions for adding
an element to a linked list and freeing the list, but instead
reimplemented them. This has been changed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Matthieu Bouron <matthieu.bouron@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-10-03 19:34:23 +02:00
Paul B Mahol 93ea21f9b7 doc/filters: fix typo 2019-10-03 17:58:46 +02:00
Paul B Mahol d0189f8d97 avfilter/vsrc_sierpinski: add triangle type 2019-10-03 14:21:39 +02:00
Paul B Mahol 22f3b6286e avfilter: add av_cold where it is missing 2019-10-03 12:09:07 +02:00
Paul B Mahol 8ca89e52df avfilter/f_streamselect: fix memleaks of pad names 2019-10-03 11:23:23 +02:00
Paul B Mahol d492907e78 avfilter/af_amix: fix filtering if specified weights are negative 2019-10-03 10:27:56 +02:00
Paul B Mahol 2a546fb7d5 avfilter/setpts: switch to activate
Also properly handle EOF timestamps.
Fixes #6833.
2019-10-02 21:05:25 +02:00
Michael Niedermayer 61dd2e07be avcodec/g2meet: Check for end of input in jpg_decode_block()
Fixes: Timeout (100sec -> 0.7sec)
Fixes: 8668/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_G2M_fuzzer-5174143888130048

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-10-02 14:49:04 +02:00
Michael Niedermayer 9c84c162e9 avcodec/g2meet: Check if adjusted pixel was on the stack
This basically checks if a pixel that was coded with prediction
and residual could have been stored using a previous case.
This avoids basically a string of 0 symbols stored in less than
50 bytes to hit a O(n²) codepath.

Fixes: Timeout (too slow to wait -> immediately)
Fixes: 8668/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_G2M_fuzzer-4895946310680576

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-10-02 14:49:04 +02:00
Paul B Mahol 9847380f5f avfilter/vf_elbg: stop leaking frame on error 2019-10-02 10:54:45 +02:00
Michael Niedermayer c4de49edc4 avformat/electronicarts: If no packet has been read at the end do not treat it as if theres a packet
Fixes: Assertion failure
Fixes: 17770/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5700606668308480

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>
2019-10-01 22:16:20 +02:00
Carl Eugen Hoyos 87b7e141a6 lavc/x264: Use FF_CODEC_CAP_INIT_THREADSAFE if x264 is new.
Usage of strtok() was removed from x264, see also b02490a4
2019-10-01 22:07:11 +02:00
Carl Eugen Hoyos 7ffa458d60 lavfi/movie: Use filter thread count for decoding threads.
Fixes ticket #7542.
2019-10-01 21:54:53 +02:00
Lou Logan 61b7676bd5 cmdutils: trailing options may be ignored
Signed-off-by: Lou Logan <lou@lrcd.com>
Signed-off-by: mypopy <mypopy@gmail.com>
2019-10-01 10:43:37 -08:00
Paul B Mahol 1b2ed0c392 avfilter/vf_drawbox: implement process_command 2019-10-01 20:28:11 +02:00
Paul B Mahol 027a53dc49 avfilter/vf_drawbox: reduce code duplication 2019-10-01 20:28:11 +02:00
Carl Eugen Hoyos a650e8c8e9 lavf/avio: Print https warning also for avio_find_protocol_name().
Helps to fix ticket #8197.
2019-10-01 19:52:47 +02:00
Paul B Mahol 3bb170e530 avfilter/f_streamselect: add check case when nothing is done
Fixes #7955.
2019-10-01 18:46:20 +02:00
Paul B Mahol f66458cfc7 avfilter/vsink_nullsink: cosmetics 2019-10-01 14:57:41 +02:00
Paul B Mahol 94b155e49b avfilter/copy: add forgotten check 2019-10-01 14:55:43 +02:00
Paul B Mahol 9cee8975c3 avfilter/asink_anullsink: cosmetics 2019-10-01 14:38:58 +02:00
Paul B Mahol a9500441a7 avfilter/vf_copy: check for error cases and handle them 2019-10-01 13:45:29 +02:00