1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-04-24 17:12:34 +02:00

98229 Commits

Author SHA1 Message Date
Michael Niedermayer
b31916c313 avcodec/tiff: Check the linearization table size
Fixes: out of array access
Fixes: 24604/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4843529818603520

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 7577f8332a6bb2f227b876c83ec6fa45cc9670f9)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-02-02 14:18:20 +01:00
Michael Niedermayer
ae3afef8c8 avformat/siff: Reject audio packets without audio stream
Fixes: Assertion failure
Fixes: 24612/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6600899842277376.fuzz

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 8931c55789a69f717b4a6954c5bb7acf5475a134)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-02-02 14:18:20 +01:00
Michael Niedermayer
dfa3c6d49f avformat/mpeg: Check avio_read() return value in get_pts()
Found-by: Thierry Foucu <tfoucu@gmail.com>
Fixes: Use-of-uninitialized-value
Reviewed-by: Thierry Foucu <tfoucu@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e8a88a16f78e66c8d7645b5f71dc8390b033fa70)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-02-02 14:18:20 +01:00
Michael Niedermayer
100a7db078 avcodec/tiff: Check bpp/bppcount for 0
Fixes: division by zero
Fixes: 24253/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-6250318007107584

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 be090da25f734460f3105075456877b8a66185c1)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-02-02 14:18:20 +01:00
Michael Niedermayer
2213582169 avcodec/snowdec: Sanity check hcoeff
Fixes: signed integer overflow: -2147483648 * -1 cannot be represented in type 'int'
Fixes: 24011/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-5486376610168832

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 d51d569cf68f78aaea8464a156c847a0e294726a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-02-02 14:18:20 +01:00
Michael Niedermayer
f7b28fc9ce avformat/mov: Check comp_brand_size
Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
Fixes: 24457/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5760093644390400

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 ffa6072fc727a14680a85449259f6b49b47587e6)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-02-02 14:18:20 +01:00
Michael Niedermayer
c017516140 avformat/ape: Error out in case of EOF in the header
Fixes: OOM
Fixes: 24375/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6216862443241472

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 a6df1fd5e96c012ba477a56b3858a310e243b921)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-02-02 14:18:20 +01:00
Michael Niedermayer
1498f31b5b avcodec/alac: Check decorr_shift to avoid invalid shift
Later the decorrelate_stereo call is guarded by channels == 2
and non-zero decorr_left_weight. Make sure decorr_shift is in
the expected shift range for that case.

Fixes: shift exponent 128 is too large for 32-bit type 'int'
Fixes: 23860/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-5751138914402304

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Alexander Strasser <eclipse7@gmx.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4333718b357a9ad195031e5d0ea080d37677b795)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-02-02 14:18:20 +01:00
Michael Niedermayer
50d23a0256 avcodec/tdsc: Fix tile checks
Fixes: out of array access
Fixes: crash.asf

Found-by: anton listov <greyfarn7@yandex.ru>
Reviewed-by: anton listov <greyfarn7@yandex.ru>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 081e3001edb67dcd55fe0f68505df1fce667476d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-02-02 14:18:20 +01:00
Anton Khirnov
666d2fc6e2 opusdec: do not fail when LBRR frames are present
Decode and discard them.

Fixes ticket 4641.

(cherry picked from commit 33b4b788aac91dfd522415baaedcbda160482816)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2021-01-26 16:28:23 +01:00
Lynne
89daac5fe2 configure: update copyright year 2021-01-01 09:44:00 +05:30
Marton Balint
ed735e6577 avfilter/vf_framerate: fix infinite loop with 1-frame input
Fixes infinite loop in:
ffmpeg -f lavfi -i testsrc=d=0.04 -vf framerate=50 -f null none

Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit 6d3b70c27ef1639784fdb3382e5a06b1afa3fe3e)
2020-12-30 23:47:53 +01:00
Michael Niedermayer
8f3741a5e3 avformat/url: Change () position in ff_make_absolute_url()
No testcase
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ef59a40c2a0df694cf6f23870f94b6e32deabfe1)
2020-12-30 23:45:03 +01:00
Marton Balint
ca55240b8c avformat/mpegts: make sure mpegts_read_header always stops at the first pmt
mpegts_read_header stops parsing the file at the first PMT. However the check
that ensured this was wrong because streams can also be added before the first
PMT is received (e.g. EIT).

So let's make sure we are in the header reading phase by checking if ts->pkt is
unset instead of checking if the number of streams found so far is 0.

Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit bf19833ae26b054a111de79b5ab1681c00cd8d0a)
2020-11-19 21:42:39 +01:00
Zane van Iperen
1936413eda
avformat/alp: fix handling of TUN files
Sample rate is always 22050. Verified by trying various files in the game.

(cherry picked from commit 5df7fd1cbefb51d3a3c89fe363dbafe0a89ada60)
2020-11-08 00:26:11 +10:00
Zane van Iperen
4fdc632a90
avformat/argo_asf: fix handling of v1.1 files
Version 1.1 (FX Fighter) files all have a sample rate of 44100
in the header, but only play back correctly at 22050.

Force the sample rate to 22050 when reading, and restrict it
when muxing.

(cherry picked from commit d2f7b399149f725138f5551ae980e755596d527c)
2020-11-08 00:16:49 +10:00
Marton Balint
c19641b2e2 swscale/x86/yuv2rgb: fix crashes when loading alpha from unaligned buffers
Regression since fc6a5883d6af8cae0e96af84dda0ad74b360a084 on SSSE3 enabled
CPUs.

Fixes ticket #8955.

Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit 993429cfb4a1a8d491d124be228cb7d620a57ba9)
2020-11-02 00:51:05 +01:00
ruiquan.crq
c464b5c205 lavf/url: fix relative url parsing when the query string or fragment has a colon
This disallows the usage of ? and # in libavformat specific scheme options
(e.g. subfile,,start,32815239,end,0,,:video.ts) but this change was considered
acceptable.

Signed-off-by: ruiquan.crq <caihaoning83@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit ae9a1a96982669926a4ecb92b066814f5f27dc38)
2020-10-28 21:41:21 +01:00
Marton Balint
074b2032e6 avformat/libsrt: fix cleanups on failed libsrt_open() and libsrt_setup()
- Call srt_epoll_release() to avoid fd leak on libsrt_setup() error.
- Call srt_cleanup() on libsrt_open() failure.
- Fix return value and method on mode parsing failure.

Based on a patch by Nicolas Sugino <nsugino@3way.com.ar>.

Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit fb0304fcc9f79a4c9cbdf347f20f484529f169ba)
2020-10-28 21:41:04 +01:00
Timo Rothenpieler
8a2acdc6da avcodec/cuviddec: backport extradata fixes 2020-10-01 21:44:54 +02:00
Timo Rothenpieler
af2a430bb1 avcodec/cuviddec: handle arbitrarily sized extradata 2020-09-30 13:55:41 +02:00
Jun Zhao
6d886b6586 lavf/srt: fix build fail when used the libsrt 1.4.1
libsrt changed the:
SRTO_SMOOTHER   -> SRTO_CONGESTION
SRTO_STRICTENC  -> SRTO_ENFORCEDENCRYPTION
and removed the front of deprecated options (SRTO_SMOOTHER/SRTO_STRICTENC)
in the header, it's lead to build fail

fix #8760

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
(cherry-pick from commit 7c59e1b0f285cd7c7b35fcd71f49c5fd52cf9315)
2020-09-21 10:51:02 +08:00
Nicolas Sugino
dae6d75a31 avformat/libsrt: close listen fd in listener mode
In listener mode the first fd is not closed when libsrt_close() is called
because it is overwritten by the new accept fd.  Added the listen_fd to the
context to properly close it when libsrt_close() is called.

Fixes trac ticket #8372.

Signed-off-by: Nicolas Sugino <nsugino@3way.com.ar>
Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit 86f5fd471d35423e3bd5c9d2bd0076b14124faee)
2020-09-08 20:16:20 +02:00
Nicolas George
5382d3b853 lavf/url: rewrite ff_make_absolute_url() using ff_url_decompose().
Also add and update some tests.

Change the semantic a little, because for filesytem paths
symlinks complicate things.
See the comments in the code for detail.

Fix trac tickets #8813 and 8814.

(cherry picked from commit 1201687da268c11459891a80ca1972aeaca8db88)
2020-09-08 20:15:23 +02:00
Nicolas George
3bb90226f9 lavf/url: add ff_url_decompose().
(cherry picked from commit d853293679f93ef882e6a5f1c47eb5a65ceddf3d)
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 97819f15a8b776e3450cc10217f646da40013bf1)
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 e76b4b2a6b488ecc3f55cb48dea971c17588d075)
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 afbe9ebac7b47fec84703459bfe64fc90c2ad937)
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 e3ed0ce32aaee0487533b10c18f81ab05fd31fa8)
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 6c20207dceefa0452c65c719f0326cbc0177e827)
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 b567cb8d0b664775201d843ab985f49fefeb25d5)
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 751f2a27f7d2efe5091ef54d73e5428160a85578)
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 13db5061ff3c0ff0ad29294e276f7829d3456f5b)
2020-08-25 18:58:59 +02:00
James Almer
799fc4d732 x86/yuv2rgb: fix crashes when storing data on unaligned buffers
Regression since fc6a5883d6af8cae0e96af84dda0ad74b360a084 on SSSE3 enabled
CPUs.

Fixes ticket #8747

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit ba3e771a42c29ee02c34e7769cfc1b2dbc5c760a)
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 55e1bc39cb3e485e5b0b6b13a41a2fd6f18ed3af)
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 320694ff84a609c5b0438c1f10da355cb48a0be3)
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 2c844c98285ca03d9cc44db920da645cf0376c40)
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 0b2b03568f22fdb361d9a44c262bfb9269335f80)
2020-07-12 11:39:23 -03:00
Michael Niedermayer
6b6b9e593d Changelog: update
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
n4.3.1
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 79e8d17024e6c6328a40fcee191ffd70798a9c6e)
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 ec3d8a0e6945fe015d16cd98a1e7dbb4be815c15

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit dde60772970ed663b85d475e741013a0222decda)
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 4a10bc8f6f5d600c44ecb9b43cd9abf13bf3bfae)
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 5d91b7718efc581da8882a4e9bf2f5953e41adbf)
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 ec59dc73f0cc8930bf5dae389cd76d049d537ca7)
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 806a4d5187aeb82b97898683242886ed1e84f894)
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 9f7b252cdf2d0e0f79d16dc7cd575d1884239863)
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 3ddc5e1f3cebca25ade54ee68159d305f210bf5f)
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 321ea59dac6538f92206bab0a2688fa24a25c4d2)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-09 12:35:39 +02:00