Commit Graph

93532 Commits

Author SHA1 Message Date
Michael Niedermayer 9a44dc209b avformat/aiffdec: Use av_rescale() for bitrate
Fixes: integer overflow
Fixes: 40313/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-4814761406103552

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>
(cherry picked from commit 905588df97)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-04-09 22:19:40 +02:00
Michael Niedermayer 8876c70ee8 avformat/aiffdec: sanity check block_align
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 93f7776921)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-04-09 22:19:40 +02:00
Michael Niedermayer 078bbcde0e avformat/aiffdec: Check sample_rate
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1b04836dff)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-04-09 22:19:40 +02:00
Paul B Mahol d5cb859665 avfilter/vf_gblur: fix heap-buffer overflow
Fixes #8282

(cherry picked from commit 64a805883d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-04-09 22:19:40 +02:00
Paul B Mahol 439645004b avfilter/vf_lenscorrection: fix division by zero
Fixes #8265

(cherry picked from commit 19587c9332)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-04-09 22:19:40 +02:00
James Almer 6fe33489be avformat/latmenc: abort if no extradata is available
Fixes ticket #8273.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit dd01947397)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-04-09 22:19:40 +02:00
Michael Niedermayer d38c8064d4 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>
(cherry picked from commit 2c78a76cb0)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-04-09 22:19:40 +02:00
Paul B Mahol 97ee4a451b avformat/tty: add probe function
(cherry picked from commit 3bce9e9b3e)
2022-04-09 22:19:40 +02:00
Michael Niedermayer 422cec5088 avcodec/flac_parser: Consider AV_INPUT_BUFFER_PADDING_SIZE
Fixes: out if array read
Fixes: 40109/clusterfuzz-testcase-minimized-ffmpeg_dem_FLAC_fuzzer-4805686811295744

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Mattias Wadman <mattias.wadman@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-04-09 22:19:40 +02:00
Michael Niedermayer f3f575e395 avcodec/ttadsp: Fix integer overflows in tta_filter_process_c()
Fixes: signed integer overflow: 822841647 + 1647055738 cannot be represented in type 'int'
Fixes: 39935/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TTA_fuzzer-4592657142251520

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f24028c798)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-04-09 22:19:40 +02:00
Michael Niedermayer fbdeea9102 avutil/mathematics: Document av_rescale_rnd() behavior on non int64 results
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e154353fdb)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-04-09 22:19:40 +02:00
James Almer 746f3fc165 fate: update reference files after the recent dash manifest muxer changes
Missed in 487b49d8f2.

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit aa0829d834)
2022-04-08 16:12:03 -03:00
James Almer ad26796f4e avformat/webmdashenc: fix on-demand profile string
Fixes ticket #9596

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 487b49d8f2)
2022-04-08 00:16:08 -03:00
Andreas Rheinhardt aa3b2c3883 configure: Add missing libshine->mpegaudioheader dependency
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
(cherry picked from commit e228d7b0db)
2022-01-06 08:49:01 +01:00
Andreas Rheinhardt 010281ed23 avformat/mpegenc: Ensure packet queue stays valid
The MPEG-PS muxer uses a custom queue of custom packets. To keep track
of it, it has a pointer (named predecode_packet) to the head of the
queue and a pointer to where the next packet is to be added (it points
to the next-pointer of the last element of the queue); furthermore,
there is also a pointer that points into the queue (called premux_packet).

The exact behaviour was as follows: If premux_packet was NULL when a
packet is received, it is taken to mean that the old queue is empty and
a new queue is started. premux_packet will point to the head of said
queue and the next_packet-pointer points to its next pointer. If
predecode_packet is NULL, it will also made to point to the newly
allocated element.

But if premux_packet is NULL and predecode_packet is not, then there
will be two queues with head elements premux_packet and
predecode_packet. Yet only elements reachable from predecode_packet are
ever freed, so the premux_packet queue leaks.
Worse yet, when the predecode_packet queue will be eventually exhausted,
predecode_packet will be made to point into the other queue and when
predecode_packet will be freed, the next pointer of the preceding
element of the queue will still point to the element just freed. This
element might very well be still reachable from premux_packet which
leads to use-after-frees lateron. This happened in the tickets mentioned
below.

Fix this by never creating two queues in the first place by checking for
predecode_packet to know whether the queue is empty. If premux_packet is
NULL, then it is set to the newly allocated element of the queue.

Fixes tickets #6887, #8188 and #8266.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
(cherry picked from commit cfce16449c)
2021-10-19 19:05:16 -03:00
Andreas Rheinhardt f7c9b1ed56 avformat/movenc: Fix segfault when remuxing rtp hint stream
When remuxing an rtp hint stream (or any stream with the tag "rtp "),
the mov muxer treats this as one of the rtp hint tracks it creates
internally when ordered to do so; yet this track lacks the
AVFormatContext for the hinting rtp muxer, leading to segfaults in
mov_write_udta_sdp() if a "trak" atom is written for this stream; if not,
the stream's codecpar is freed by mov_free() as if the mov muxer owned
it (it does for the internally created "rtp " tracks), but without
resetting st->codecpar, leading to double-frees lateron. This commit
therefore ignores said tag which makes rtp hint streams unremuxable.

This fixes tickets #8181 and #8186.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
(cherry picked from commit 22c3cd1760)
2021-10-19 19:03:19 -03:00
Baptiste Coudurier 3c4e1a56e3 avformat/mxfenc: fix index byte count in partition header 2021-10-19 19:01:36 -03:00
Michael Niedermayer a5d2008e2a Changelog: update
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-10-17 19:42:14 +02:00
Lynne d7bd4f73a7 configure: update copyright year
(cherry picked from commit 63505fc60a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-10-16 21:19:24 +02:00
Michael Niedermayer 9d8945bd49 avformat/wavdec: Check smv_block_size
Fixes: Timeout
Fixes: 39554/clusterfuzz-testcase-minimized-ffmpeg_dem_WAV_fuzzer-4915221701984256

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 849138f476)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-10-16 21:19:24 +02:00
Michael Niedermayer 770b4de8d1 avformat/rmdec: Check for multiple audio_stream_info
Fixes: memleak
Fixes: 39166/clusterfuzz-testcase-minimized-ffmpeg_dem_IVR_fuzzer-5153276690038784

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 8fe3566b8f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-10-16 21:19:24 +02:00
Michael Niedermayer 3c81d7025e avcodec/apedec: Use 64bit to avoid overflow
Fixes: runtime error: signed integer overflow: 727298502 * 3 cannot be represented in type 'int'
Fixes: 39172/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-638602483033702

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f059b56195)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-10-16 21:19:24 +02:00
Michael Niedermayer 9236882745 avcodec/apedec: Fix undefined integer overflow in long_filter_ehigh_3830()
Fixes: signed integer overflow: -2145648640 - 3357696 cannot be represented in type 'int'
Fixes: 38899/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5358815017566208

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ad517ee6e4)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-10-16 21:19:24 +02:00
Michael Niedermayer 186222fa56 oavformat/avidec: Check offset in odml
Fixes: signed integer overflow: 9223372036854775807 + 8 cannot be represented in type 'long'
Fixes: 38787/clusterfuzz-testcase-minimized-ffmpeg_dem_AVI_fuzzer-4859845799444480

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 255a7b423e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-10-16 21:19:24 +02:00
Michael Niedermayer e295b5f3d3 avformat/mpegts: use actually read packet size in mpegts_resync special case
Fixes: infinite loop
Fixes: 37986/clusterfuzz-testcase-minimized-ffmpeg_dem_MPEGTSRAW_fuzzer-5292311517462528 -

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 83b2e4c8f1)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-10-16 21:19:24 +02:00
Timo Rothenpieler 0699b0836d avfilter/scale_npp: fix non-aligned output frame dimensions 2021-10-07 18:31:41 +02:00
Michael Niedermayer ef2efaa78b Update for 4.1.8 2021-10-06 13:43:40 +02:00
Michael Niedermayer ff48f4aad7 swscale/alphablend: Fix slice handling
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 06d6726588)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-10-06 12:06:15 +02:00
Michael Niedermayer c59e2d2f03 avcodec/mxpegdec: Check for AVDISCARD_ALL
Fixes: Fixes NULL pointer dereference
Fixes: 36610/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MXPEG_fuzzer-6052641783283712
Fixes: 37907/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MXPEG_fuzzer-4725170850365440
Fixes: 37904/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MXPEG_fuzzer-6367889262247936
Fixes: 38085/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MXPEG_fuzzer-5175270823297024

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 20afd3a63a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-10-06 12:06:15 +02:00
Michael Niedermayer 800e7d83e8 avcodec/flicvideo: Check remaining bytes in FLI*COPY
Fixes: Timeout
Fixes: 37795/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FLIC_fuzzer-4846536543043584

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5f835efbca)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-10-06 12:06:15 +02:00
Michael Niedermayer 512a132e4c avcodec/cbs_h265_syntax_template: Limit sps_num_palette_predictor_initializer_minus1 to 127
Fixes: index 128 out of bounds for type 'uint16_t [128]'
Fixes: 38651/clusterfuzz-testcase-minimized-ffmpeg_BSF_HEVC_METADATA_fuzzer-6296416058736640

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>
(cherry picked from commit 85413a5ae6)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-10-06 12:06:15 +02:00
Michael Niedermayer 448e9ce5e5 avcodec/mpeg12dec: Do not put mpeg_f_code into an invalid state on error return
Fixes: invalid shift
Fixes: 37018/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG2VIDEO_fuzzer-5290280902328320

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5a95abcce4)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-10-06 12:06:15 +02:00
Michael Niedermayer 552430993d avcodec/mpegvideo_enc: Limit bitrate tolerance to the representable
Fixes: error: 1.66789e+11 is outside the range of representable values of type 'int'
Fixes: Ticket8201

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 245017ec8a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-10-06 12:06:15 +02:00
Michael Niedermayer 25f9794e56 avcodec/apedec: Fix integer overflow in intermediate
Fixes: signed integer overflow: 559334865 * 4 cannot be represented in type 'int'
Fixes: 37929/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-6751932295806976

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 90da43557f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-10-06 12:06:15 +02:00
Michael Niedermayer ea9fc9676c avformat/mvdec: Do not set invalid sample rate
Fixes: signed integer overflow: -682581959642593728 * 16 cannot be represented in type 'long'
Fixes: 37883/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-5311691517198336

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>
(cherry picked from commit 737e6bf216)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-10-06 12:06:15 +02:00
Michael Niedermayer a214f6e238 avformat/rmdec: Use 64bit for intermediate for DEINT_ID_INT4
Fixes: runtime error: signed integer overflow: 65312 * 65535 cannot be represented in type 'int'
Fixes: 32832/clusterfuzz-testcase-minimized-ffmpeg_dem_RM_fuzzer-4817710040088576

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e2c2872393)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-10-06 12:06:15 +02:00
Michael Niedermayer ecb7f15b7b avformat/mov: Check for duplicate clli
Fixes: memleak
Fixes: 35261/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-4869656287510528

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9a222f140e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-10-06 11:44:12 +02:00
Michael Niedermayer f997f89071 avformat/jacosubdec: Check for min in t overflow in get_shift()
Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
Fixes: 34651/clusterfuzz-testcase-minimized-ffmpeg_dem_JACOSUB_fuzzer-5157941012463616

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 989febfbd0)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-10-06 11:44:12 +02:00
Michael Niedermayer 6992f5f665 avformat/mxfdec: check channel number in mxf_get_d10_aes3_packet()
Fixes: Out of array access
Fixes: 37030/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5387719147651072

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>
(cherry picked from commit 3dd5a8a135)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-10-06 11:44:12 +02:00
Paul B Mahol d7490ef341 avfilter/vf_bwdif: fix heap-buffer overflow
Fixes #8261

(cherry picked from commit 8c3166e1c3)
Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-13 16:51:43 -03:00
Paul B Mahol 8c9ff740a3 avfilter/vf_bm3d: fix heap-buffer overflows
Fixes #8262

(cherry picked from commit 0749082eb9)
Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-13 16:51:43 -03:00
Paul B Mahol f1fc3fe317 avfilter/vf_floodfill: finish early if source and destination fill matches
Fixes #8236

(cherry picked from commit 1331e00179)
Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-13 16:51:43 -03:00
Paul B Mahol ac5a7d5a67 avfilter/vf_edgedetect: fix heap-buffer overflow
Fixes #8275

(cherry picked from commit de598f82f8)
Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-13 16:51:43 -03:00
Paul B Mahol da3d6068f3 avfilter/vf_w3fdif: deny processing small videos
Fixes #8243

(cherry picked from commit 0e68e8c93f)
Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-13 16:51:43 -03:00
Paul B Mahol df5e017709 avfilter/af_afade: fix heap-buffer overflow
Fixes #8276

(cherry picked from commit e1b89c76f6)
Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-13 16:50:46 -03:00
Paul B Mahol 29f1cf0c0f avfilter/vf_colorconstancy: fix overreads in gauss array
Fixes #8250

(cherry picked from commit a7fd127970)
Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-13 16:50:33 -03:00
Paul B Mahol e06e89f627 avcodec/pngenc: remove monowhite from apng formats
Monowhite pixel format is not supported, and it does not make sense
to add support for it.

Fixes #7989

(cherry picked from commit 5d9f44da46)
Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-13 16:50:33 -03:00
Paul B Mahol aef4cbec69 avfilter/vf_datascope: fix heap buffer overflow
Fixes #8309

(cherry picked from commit d4d6b7b035)
Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-13 16:50:33 -03:00
Paul B Mahol d60effdf83 avfilter/vf_fieldmatch: fix heap-buffer overflow
Also fix use of uninitialized values.

Fixes #8239

(cherry picked from commit ce5274c138)
Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-13 16:50:33 -03:00
Paul B Mahol c79606f233 avfilter/vf_fieldorder: fix heap-buffer overflow
Fixes #8264

(cherry picked from commit 07050d7bdc)
Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-13 16:50:32 -03:00