Commit Graph

95484 Commits

Author SHA1 Message Date
Michael Niedermayer a76897e19c avcodec/smacker: Fix integer overflows in pred[] in smka_decode_frame()
Fixes: signed integer overflow: -2147481503 + -32732 cannot be represented in type 'int'
Fixes: 17782/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMACKAUD_fuzzer-5769672225456128

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-20 19:57:51 +02:00
Michael Niedermayer 8c69310477 avcodec/aliaspixdec: Check input size against minimal picture size
Fixes: Timeout (15sec -> 72ms)
Fixes: 17774/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALIAS_PIX_fuzzer-5193929107963904

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-20 19:57:51 +02:00
Michael Niedermayer 7916b6863c avcodec/ffwavesynth: Fix integer overflows in pink noise addition
Fixes: signed integer overflow: -1795675744 + -1926578528 cannot be represented in type 'int'
Fixes: 17741/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFWAVESYNTH_fuzzer-5131336402075648

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-20 19:57:51 +02:00
Michael Niedermayer 6fdeb20817 avcodec/vc1_block: Fixes integer overflow in vc1_decode_i_block_adv()
Fixes: signed integer overflow: 62220 * 262144 cannot be represented in type 'int'
Fixes: 17145/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5667394743173120

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-20 19:57:51 +02:00
Michael Niedermayer fe63ace98e tools/target_dec_fuzzer: Adjust threshold for DXV
Fixes: TImeout (20sec -> 4sec)
Fixes: 17735/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_fuzzer-5723368317255680

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-20 19:57:51 +02:00
Michael Niedermayer c1c799271e avcodec/wmalosslessdec: Check block_align
Fixes: NULL pointer dereference
Fixes: 18331/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5652847445671936

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-20 19:24:53 +02:00
Paul B Mahol 673fce6d40 avfilter/vf_tile: fix memory leak
Fixes #8313
2019-10-20 18:06:26 +02:00
Paul B Mahol 357f11eca2 avfilter/vf_atadenoise: add support for commands 2019-10-20 12:10:16 +02:00
Paul B Mahol 824b026d91 avfilter/vf_shuffleframes: improve error message 2019-10-20 11:39:24 +02:00
James Almer 31aafdac24 avformat/options: don't call avformat_free_context() within avformat_alloc_context()
avformat_free_context() expects AVFormatContext->internal to not be NULL.

Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-10-19 21:29:36 -03:00
James Almer 90e37adab7 avformat/nutenc: free all missing dynamic AVIOContext on header writing failure
Fixes part of ticket #8316

Signed-off-by: James Almer <jamrial@gmail.com>
2019-10-19 14:42:23 -03:00
Paul B Mahol 58bb9d3a3a avfilter/af_tremolo: fix heap-buffer overflow
Fixes #8317
2019-10-19 19:34:47 +02:00
Paul B Mahol 26876fdb5e avfilter/vf_fftdnoiz: round toward nearest integer
Instead of rounding toward zero and thus producing
darker output.
2019-10-19 19:07:28 +02:00
Paul B Mahol a60232ab2d avfilter/vf_bm3d: round values toward nearest integer
Instead of rounding toward zero and thus producing
darker output.
2019-10-19 18:53:48 +02:00
Paul B Mahol 7080bbfef4 avfilter/vf_bm3d: forward status back 2019-10-19 18:46:14 +02:00
Andreas Rheinhardt fee1bffbc2 mpeg4_unpack_bframes: Merge close and flush
They are identical now.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-10-19 18:20:44 +02:00
Andreas Rheinhardt 6090ac1d04 avcodec/zmbv: Call decode_intra directly
zmbv has only one function for decoding intra frames, namely
decode_intra; and yet up until now it has been called via a function
pointer. This has been changed.

This also removes spec-incompliant conversions between function pointers
and pointers of type void * and thereby fixes the warning "ISO C forbids
assignment between function pointer and ‘void *’" that GCC emits with
the -pedantic option.

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-19 18:20:44 +02:00
Michael Niedermayer 2c78a76cb0 avcodec/g729dec: Avoid computing invalid temporary pointers for ff_acelp_weighted_vector_sum()
Fixes: Ticket8176

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-10-19 18:20:44 +02:00
Michael Niedermayer 5f0acc5064 avcodec/g729postfilter: Fix left shift of negative value
Fixes: Ticket8176

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-10-19 18:20:44 +02:00
Paul B Mahol 7056ddc0e0 avfilter/vf_fieldhint: add support for duplicating fields
Fixes #7066
2019-10-19 13:08:37 +02:00
Paul B Mahol ce5274c138 avfilter/vf_fieldmatch: fix heap-buffer overflow
Also fix use of uninitialized values.

Fixes #8239
2019-10-19 11:58:34 +02:00
Paul B Mahol c8f3915f8d avfilter/vf_decimate: fix memory leaks
Fixes #8311
2019-10-19 10:18:35 +02:00
Paul B Mahol 723d69f99c avfilter/vf_lagfun: fix heap-buffer overflow
Fixes #8310
2019-10-19 09:56:53 +02:00
Paul B Mahol d4d6b7b035 avfilter/vf_datascope: fix heap buffer overflow
Fixes #8309
2019-10-19 09:50:53 +02:00
Gyan Doshi ed78ca4123 doc/utils: add hexadecagonal channel layout 2019-10-19 13:00:36 +05:30
Steven Liu 9f023017ab avformat/sapdec: check av_strdup() return value and fix memleak
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-10-19 06:56:52 +02:00
Steven Liu b1071b405d avformat/mvdec: check av_strdup() return value
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-10-19 06:56:02 +02:00
Steven Liu 53928e0b49 avformat/mtv: check av_strdup() return value
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-10-19 06:54:53 +02:00
Steven Liu f5263172de avformat/mpeg: check av_strdup() return value
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-10-19 06:54:12 +02:00
Steven Liu 1f7b527194 avformat/libsrt: check av_strdup() return value and fix memleak
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-10-19 06:49:46 +02:00
Steven Liu 17d96c15d2 avformat/hlsenc: check av_strdup() return value
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-10-19 06:48:49 +02:00
Steven Liu 25f5d67a31 avformat/cinedec: check av_strdup() return value
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-10-19 06:47:10 +02:00
James Almer 0700e7247b avformat/mpegenc: check for stream private data during deinit
Prevents pointer dereferences when streams were not fully initialized.

Signed-off-by: James Almer <jamrial@gmail.com>
2019-10-18 23:14:40 -03:00
James Almer 1d479300cb avformat/nutenc: don't allocate a dynamic AVIOContext if no index is going to be written
Fixes ticket #8295

Signed-off-by: James Almer <jamrial@gmail.com>
2019-10-18 20:53:10 -03:00
Paul B Mahol 0528adbd85 avfilter/vf_shuffleplanes: add mising query_formats()
Fixes #8298
2019-10-18 23:24:06 +02:00
Paul B Mahol 3b580f9dfe avfilter/vf_maskfun: fix memleak
Fixes #8305
2019-10-18 21:57:20 +02:00
Paul B Mahol 8e30514c4c avfilter/buffersink: cosmetics 2019-10-18 10:54:05 +02:00
Paul B Mahol fddef964e8 avfilter/vf_colorspace: fix memmory leaks
Fixes #8303
2019-10-18 10:48:22 +02:00
Paul B Mahol daf2bef98d avfilter/af_acrossover: fix memory leak
Fixes #8304
2019-10-18 10:33:54 +02:00
Jun Zhao feaec3bc31 lavf/hlsenc: fix memory leak
fix memory leak

Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-10-18 09:58:50 +08:00
Jun Zhao ed3c317dea fftools/ffmpeg_opt: add error handle if av_asprintf return null
add error handle if av_asprintf return null.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-10-18 09:56:51 +08:00
Jun Zhao 85e2b222e9 lavfi/avf_showspectrum: add error handle if av_asprintf return null
add error handle if av_asprintf return null.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-10-18 09:56:27 +08:00
Paul B Mahol 0ae6fb276b avfilter/x86/vf_atadenoise: add SIMD for serial too 2019-10-17 21:05:50 +02:00
Paul B Mahol 71e33c6e01 avfilter/vf_atadenoise: add option to use additional algorithm 2019-10-17 20:28:31 +02:00
Paul B Mahol 295d99b439 avfilter/vf_adadenoise: add x86 SIMD 2019-10-17 19:44:11 +02:00
Andreas Rheinhardt eb17bf6fd3 mpeg4_unpack_bframes: Avoid allocations and copies of packet structures
1. Since bd90a2ec, mpeg4_unpack_bframes caches whole packets instead of
just the pointer to the buffer and the buffer's size in order to be able
to make use of refcounting to avoid copying of data; this unfortunately
introduced copies of packet structures and side data (if existing),
although the only fields that are needed are the buffer-related ones
(data, size and buf). This can be changed without compromising the
advantages of refcounting by storing a reference to the buffer.

2. This change also makes it easy to use only one packet throughout
so that an allocation and free of an AVPacket structure per filtered
packet can be saved by switching to ff_bsf_get_packet_ref.

3. Furthermore, this commit also fixes a memleak introduced in bd90a2ec:
If a stored b_frame with side data was used for a later frame, the side
data would leak when the input frame's properties were copied into the
output frame.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-10-17 18:04:37 +02:00
Michael Niedermayer 2fca09bce4 avcodec/binkaudio: Check sample rate
Fixes: signed integer overflow: 1092624416 * 2 cannot be represented in type 'int'
Fixes: 18045/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BINKAUDIO_RDFT_fuzzer-5718519492116480

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-10-17 18:04:37 +02:00
Andreas Rheinhardt b288a7eb3d avformat/mpegenc: Fix memleaks and return values
If there is an error in mpeg_mux_init() (the write_header function of
the various MPEG-PS muxers), two things might happen:

1. Several fifos might leak. Instead of freeing them, the goto fail part
of the functions freed the private data of the AVStreams instead,
although this will be freed later in free_stream() anyway.
2. And if the function is exited via goto fail, it automatically
returned AVERROR(ENOMEM), although this is also used when the error is
not a memory allocation failure.

Both of these issues happened in ticket #8284 and have been fixed.

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-17 18:04:37 +02:00
James Almer 39d5acbd09 avcodec/libdav1d: set AVFrame reordered_opaque
Fixes ticket #8300

Signed-off-by: James Almer <jamrial@gmail.com>
2019-10-17 12:35:28 -03:00
Andreas Rheinhardt ba191c0ce0 vp9_superframe: Avoid allocations and copies of packet structures
Up until now, the vp9_superframe bsf used distinct packets for input and
output. But at no point in the bsf are the input and output packets used
at the same time (except during a call to av_packet_move_ref()), so that
one can avoid using two packets if one switches to ff_bsf_get_packet_ref
at the same time. This also saves one malloc+free of an AVPacket
structure per filtered packet.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-10-17 12:35:23 -03:00