Commit Graph

98205 Commits

Author SHA1 Message Date
Nicolas George
3bb90226f9 lavf/url: add ff_url_decompose().
(cherry picked from commit d853293679)
2020-09-08 20:15:15 +02:00
James Almer
a15a3318e1 avcodec/cbs_av1: fix setting FrameWidth in frame_size_with_refs()
Section 5.9.7 of the spec states

    UpscaledWidth = RefUpscaledWidth[ ref_frame_idx[ i ] ]
    FrameWidth    = UpscaledWidth
    FrameHeight   = RefFrameHeight[ ref_frame_idx[ i ] ]
    RenderWidth   = RefRenderWidth[ ref_frame_idx[ i ] ]
    RenderHeight  = RefRenderHeight[ ref_frame_idx[ i ] ]

Meaning FrameWidth must not be set to RefFrameWidth[ ref_frame_idx[ i ] ]
like we're currently doing.

Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-09-05 22:30:38 -03:00
James Almer
f94134b22a avcodec/cbs_av1: use a more appropiate AV1ReferenceFrameState pointer variable name
frame is more commonly used for AV1RawFrameHeader and AV1RawFrame.

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 97819f15a8)
2020-09-05 22:30:32 -03:00
James Almer
74c9965096 avcodec/cbs_av1: fix handling reference frames on show_existing_frame frames
Implement Section 7.21 "Reference frame loading process" and Section 7.20
"Reference frame update process" for show_existing_frame frames, as required by
the definition in Section 7.4 "Decode frame wrapup process".

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit e76b4b2a6b)
2020-09-05 22:30:23 -03:00
James Almer
af72c16468 avcodec/cbs_av1: infer frame_type in show_existing_frame frames earlier
This follows the spec and will come in handy in the next commit.

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit afbe9ebac7)
2020-09-05 22:30:18 -03:00
James Almer
408592c838 avcodec/cbs_av1: add OrderHint to CodedBitstreamAV1Context
This follows the spec and will come in handy in a following commit.

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit e3ed0ce32a)
2020-09-05 22:30:12 -03:00
James Almer
f73c4487ef avcodec/cbs_av1: infer frame_type when parsing a show_existing_frame frame
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 6c20207dce)
2020-09-05 22:30:07 -03:00
Mark Thompson
f070c53c7a cbs_av1: Fix test for presence of buffer_removal_time element
The frame must be in both the spatial and temporal layers for the
operating point, not just one of them.

(cherry picked from commit b567cb8d0b)
2020-09-05 22:30:01 -03:00
James Almer
3a66177fef avcodec/cbs_av1: fix storage size for render_{width,height}_minus_1
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 751f2a27f7)
2020-09-05 21:36:03 -03:00
Carl Eugen Hoyos
0a012a5338 lavc: Lower MediaFoundation audio encoder priority.
The actual encoders may not be available.
Fixes ticket #8699.

(cherry picked from commit 13db5061ff)
2020-08-25 18:58:59 +02:00
James Almer
799fc4d732 x86/yuv2rgb: fix crashes when storing data on unaligned buffers
Regression since fc6a5883d6 on SSSE3 enabled
CPUs.

Fixes ticket #8747

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit ba3e771a42)
2020-07-17 11:53:47 -03:00
James Almer
d913badb9f checkasm/vf_blend: use the correct depth parameters to initialize the blend modes
This effectively enables the tests that until now were just running
the C version alone.

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 55e1bc39cb)
2020-07-12 11:39:40 -03:00
James Almer
8fd7d3864d x86/vf_blend: fix warnings about trailing empty parameters
Finishes fixing ticket #8771

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 320694ff84)
2020-07-12 11:39:35 -03:00
James Almer
590a36acbd x86/h264_deblock: fix warning about trailing empty parameter
Fixes part of ticket #8771

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 2c844c9828)
2020-07-12 11:39:29 -03:00
Henrik Gramner
bb3490e7f9 avutil/x86inc: fix warnings when assembling with Nasm 2.15
Some new warnings regarding use of empty macro parameters has
been added, so adjust some x86inc code to silence those.

Fixes part of ticket #8771

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 0b2b03568f)
2020-07-12 11:39:23 -03:00
Michael Niedermayer
6b6b9e593d Changelog: update
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-11 00:26:17 +02:00
Michael Niedermayer
5086d22697 avcodec/tiff: Check input space in dng_decode_jpeg()
Fixes: out of array read
Fixes: 24034/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5111884337119232

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 79e8d17024)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-11 00:25:33 +02:00
Michael Niedermayer
3c4679c430 avcodec/mjpeg_parser: Adjust size rejection threshold
Fixes: 86987846-429c8d80-c197-11ea-916b-bb4738e09687.jpg
Fixes: Regression since ec3d8a0e69

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit dde6077297)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-11 00:25:33 +02:00
Michael Niedermayer
832652a9d1 avcodec/cbs_jpeg: Fix uninitialized end index in cbs_jpeg_split_fragment()
Fixes: Out of array read
Fixes: 24043/clusterfuzz-testcase-minimized-ffmpeg_BSF_TRACE_HEADERS_fuzzer-5084566275751936.fuzz

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 4a10bc8f6f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-11 00:25:33 +02:00
Andreas Rheinhardt
9ee65bf88d avformat/sdp: Fix potential write beyond end of buffer
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
(cherry picked from commit 5d91b7718e)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-07-10 20:52:00 +02:00
Andreas Rheinhardt
be84216c53 avformat/mm: Check for existence of audio stream
No audio stream is created unconditionally and if none has been created,
no packet with stream_index 1 may be returned. This fixes an assert in
ff_read_packet() in libavformat/utils reported in ticket #8782.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
(cherry picked from commit ec59dc73f0)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-07-10 20:52:00 +02:00
Michael Niedermayer
401b59e4c3 Update for 4.3.1
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-09 22:17:30 +02:00
Zhao Zhili
d4ced9ebb7 avformat/mov: Fix unaligned read of uint32_t and endian-dependance in mov_read_default
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 806a4d5187)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-09 12:35:39 +02:00
Michael Niedermayer
b021eba8b6 avcodec/apedec: Fix undefined integer overflow with 24bit
Fixes: signed integer overflow: 8683744 * 256 cannot be represented in type 'int'
Fixes: 23527/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5679885932822528

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 9f7b252cdf)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-09 12:35:39 +02:00
Michael Niedermayer
093c2dd644 avcodec/loco: Fix integer overflow with large values from loco_get_rice()
Fixes: signed integer overflow: 155 + 2147483647 cannot be represented in type 'int'
Fixes: 23421/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LOCO_fuzzer-5652849097965568

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 3ddc5e1f3c)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-09 12:35:39 +02:00
Michael Niedermayer
99eb08f390 avformat/smjpegdec: Check the existence of referred streams
Fixes: Assertion failure
Fixes: 23758/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5160954605338624.fuzz

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 321ea59dac)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-09 12:35:39 +02:00
Michael Niedermayer
b228e0c5f6 avcodec/tiff: Check frame parameters before blit for DNG
Fixes: out of array access
Fixes: 23888/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-6021365974171648.fuzz

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 4091f4f780)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-09 12:35:39 +02:00
Michael Niedermayer
11a10e30a9 avcodec/mjpegdec: Limit bayer to single plane outputting format
This reduces the number of paths reachable with DNG and should
improve security

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 865a34970e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-09 12:35:39 +02:00
Michael Niedermayer
f98f29de5e avcodec/pnmdec: Fix misaligned reads
Found-by: "Steinar H. Gunderson" <steinar+ffmpeg@gunderson.no>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ea28ce9bc1)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-09 12:35:39 +02:00
Michael Niedermayer
531ddbacb5 avcodec/mv30: Fix integer overflows in idct2_1d()
Fixes: signed integer overflow: 6500736 * 473 cannot be represented in type 'int'
Fixes: 23259/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MV30_fuzzer-5179394271477760

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 3b8d5bcc31)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-09 12:35:39 +02:00
Michael Niedermayer
d25345bb00 avcodec/hcadec: Check total_band_count against imdct_in size
Fixes: index 128 out of bounds for type 'float [128]'
Fixes: 23465/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HCA_fuzzer-5089866596745216

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 2d96c94531)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-09 12:35:39 +02:00
Michael Niedermayer
1ff86cb452 avcodec/scpr3: Fix out of array access with dectab
Fixes: 23721/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SCPR_fuzzer-5914074721550336

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 c8de8dfba6)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-09 12:35:39 +02:00
Michael Niedermayer
f1ebea7c91 avcodec/tiff: Do not overrun the array ends in dng_blit()
Fixes: out of array access
Fixes: 23589/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5110559589793792.fuzz

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 f35caea77f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-09 12:35:39 +02:00
Michael Niedermayer
c86a9d5b82 avcodec/dstdec: Replace AC overread check by sample rate check
Real files do skip coding 0 bits at the end, thus this kind of check
does not work reliable.

Fixes: Ticket 8770
Fixes: dst-256fs44-6ch-refdstencoder.dff

The samplerate is specified in ISO/IEC 14496-3:2005(E) as one of 3 fixed
values, this also can be used to limit the duration and avoid the timeout

This reverts commit f6df99dba1.

(cherry picked from commit 1679f23beb)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-09 12:35:39 +02:00
Reimar Döffinger
1f32d8ea23 dnn_backend_native: Add overflow check for length calculation.
We should not silently allocate an incorrect sized buffer.
Fixes trac issue #8718.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: Guo, Yejun <yejun.guo@intel.com>
2020-07-06 20:25:50 +08:00
Andreas Rheinhardt
7cbb6ee2ee avcodec/h264_metadata_bsf: Fix invalid av_freep
This bug was introduced in 3c8a2a1180.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
(cherry picked from commit 04e06beb0a)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-07-04 22:33:21 +02:00
James Almer
acefb59ac5 avcodec/cbs_h265: set default VUI parameters when vui_parameters_present_flag is false
Based on cbs_h264 code.

Should fix ticket #8752.

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit d1c55fc460)
2020-07-02 22:26:39 -03:00
Manoj Bonda
797574400d avcodec/av1_parser: initialize avctx->pix_fmt
Initialize avctx->pix_fmt in av1_parser.c
AV1 Chroma format is invalid when quering using below code if no AV1 decoder
is available:

iVideoStream = av_find_best_stream(fmtc, AVMEDIA_TYPE_VIDEO, -1, -1, NULL, 0);
eChromaFormat = (AVPixelFormat)fmtc->streams[iVideoStream]->codecpar->format;

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 23d06f606e)
2020-07-02 22:26:39 -03:00
James Almer
b303fe926e avcodec/av1_parser: add missing parsing for RGB pixel format signaling
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit af6cddae1f)
2020-07-02 22:26:39 -03:00
James Almer
8f5f453998 avcodec/av1_parser: set context values outside the OBU parsing loop
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 634a44db5a)
2020-07-02 22:26:39 -03:00
Michael Niedermayer
836f6fb567 avutil/avsscanf: Add () to avoid integer overflow in scanexp()
Fixes: signed integer overflow: 2147483610 + 52 cannot be represented in type 'int'
Fixes: 23260/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PBM_fuzzer-5187871274434560

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 42b28565aa)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-02 10:20:36 +02:00
Michael Niedermayer
3571d9d654 avformat/utils: reorder duration computation to avoid overflow
Fixes: signed integer overflow: 8 * 9223372036854774783 cannot be represented in type 'long'
Fixes: 23381/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-4818340509122560

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 10cc82c35b)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-02 10:20:36 +02:00
Michael Niedermayer
f27a510211 avcodec/pngdec: Check for fctl after idat
Fixes: out of array access
Fixes: 23554/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-4796622520451072.fuzz

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 65b1ba680f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-02 10:20:36 +02:00
Michael Niedermayer
a3fdeb0c3a avformat/hls: Pass a copy of the URL for probing
The segments / url can be modified by the io read when reloading

This may be an alternative or additional fix for Ticket8673
as a further alternative the reload stuff could be disabled during
probing

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b5e39880fb)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-02 10:20:36 +02:00
Michael Niedermayer
199d6a049a avutil/common: Fix integer overflow in av_ceil_log2_c()
Fixes: left shift of 1913647649 by 1 places cannot be represented in type 'int'
Fixes: 23572/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5082619795734528

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 e409262837)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-02 10:20:36 +02:00
Michael Niedermayer
f4affa071a avcodec/wmalosslessdec: fix overflow with pred in revert_cdlms
Fixes: signed integer overflow: 2048 + 2147483646 cannot be represented in type 'int'
Fixes: 23538/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5227567073460224

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 21598d711d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-02 10:20:36 +02:00
Michael Niedermayer
c05d51c067 avformat/mvdec: Fix integer overflow with billions of channels
Fixes: signed integer overflow: 1394614304 * 2 cannot be represented in type 'int'
Fixes: 23491/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5697377020411904

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 b6fbbe08c3)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-02 10:20:36 +02:00
Michael Niedermayer
3ce81bf960 avformat/microdvddec: skip malformed lines without frame number.
Fixes: signed integer overflow: 1 - -9223372036854775808 cannot be represented in type 'long'
Fixes: 23490/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5133490093031424

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>
(cherry picked from commit a8fb7612a9)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-02 10:20:36 +02:00
Guo Yejun
dd273d359e dnn_backend_native: check operand index
it fixed the issue in https://trac.ffmpeg.org/ticket/8716
(cherry-pick from 0b3bd001ac)
Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
2020-07-02 09:03:24 +08:00
Guo Yejun
5530748bfd dnn_backend_native.c: refine code for fail case
(cherry-pick from fc932195ab)
Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
2020-07-02 09:01:41 +08:00