Commit Graph

317 Commits

Author SHA1 Message Date
cyberbox
3b0fb00990
upgrade ffmpeg from 4.4.1 to 5.1.4
Signed-off-by: cyberbox <468042667@qq.com>
Change-Id: I63cc2a8c9ff6197c67d6b6b47c124882ad942a22
2024-04-25 17:20:18 +08:00
vvtest
df7caf8708
ffmpeg回退
Signed-off-by: vvtest <815508462@qq.com>
2024-02-05 11:18:57 +00:00
vvtest
e022934105
ffmpeg升级
Signed-off-by: vvtest <815508462@qq.com>
2024-01-24 09:12:57 +00:00
gg0907
65994f5530 upgrade to 4.4.1
Signed-off-by: gg0907 <guohui_1701@163.com>
2022-05-23 11:23:35 +08:00
Michael Niedermayer
f823932349 avcodec/mpeg4videodec: Fix 2 integer overflows in get_amv()
Fixes: signed integer overflow: -144876608 * 16 cannot be represented in type 'int'
Fixes: 22782/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-6039584977977344

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 e361785ee05cc75d3caacf2f254160b0336f5358)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-06-14 22:02:34 +02:00
Michael Niedermayer
c372189443 avcodec/mpeg4videodec: avoid invalid values and reinitialize in format changes for studio profile
Fixes: out of array access
Fixes: 23327/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5134822992510976

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 e53235f06c229a23d3241b47e32647019161fb7c)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-06-14 22:02:34 +02:00
Mark Thompson
2594f6a362 lavc: Rename hwaccel.h to hwconfig.h
This already applied to decoders as well as hwaccels, and adding encoder
support was going to make the name even more inaccurate.
2020-04-26 18:38:25 +01:00
Anton Khirnov
1f4cf92cfb pthread_frame: merge the functionality for normal decoder init and init_thread_copy
The current design, where
- proper init is called for the first per-thread context
- first thread's private data is copied into private data for all the
  other threads
- a "fixup" function is called for all the other threads to e.g.
  allocate dynamically allocated data
is very fragile and hard to follow, so it is abandoned. Instead, the
same init function is used to init each per-thread context. Where
necessary, AVCodecInternal.is_copy can be used to differentiate between
the first thread and the other ones (e.g. for decoding the extradata
just once).
2020-04-10 15:24:54 +02:00
Anton Khirnov
665e5b0fba lavc: replace AVCodecInternal.allocate_progress with an internal cap
This is a constant codec property, so a capability flag is more appropriate.
2020-04-10 14:16:39 +02:00
Anton Khirnov
7385ffbd31 mpeg4videodec: do not copy a range of fields at once
This is extremely fragile against reordering and hides what is actually
being copied. Copy all the fields manually instead.
2020-04-10 14:16:22 +02:00
Michael Niedermayer
a15d904ad7 avcodec: Replace get_bits_long() by get_bits() where possible
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-12-31 18:43:50 +01:00
Michael Niedermayer
79d5d79f38 avcodec: Replace show_bits_long() by show_bits() where possible
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-12-31 18:43:50 +01:00
Michael Niedermayer
fccc37ca85 repeat an even number of characters in occured
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-16 00:04:18 +02:00
Michael Niedermayer
0e4a0e962c avcodec/mpeg4videodec: Fix integer overflow in mpeg4_decode_studio_block()
Fixes: signed integer overflow: 24023040 * 112 cannot be represented in type 'int'
Fixes: 16570/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5173275211071488

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Kieran Kunhya <kierank@obe.tv>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-11 22:42:19 +02:00
Michael Niedermayer
d227ed5d59 avcodec/mpeg4videodec: Check idx in mpeg4_decode_studio_block()
Fixes: Out of array access
Fixes: 13500/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5769760178962432

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Kieran Kunhya <kierank@obe.tv>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-03-12 00:48:56 +01:00
Andreas Rheinhardt
3f086a2f66 avcodec/mpeg4videodec: Fix nonsense warning
Since db77230894 parsing of
mpeg4-extradata lead to a "Failed to parse extradata" warning, because
ff_mpeg4_decode_picture_header returns AVERROR_INVALIDDATA in case that
no VOP was found. This patch adds a parameter to signify whether a
header (where the absence of a VOP does not raise an error) or not is
parsed. The first mode is of course used for parsing headers.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-03-12 00:48:56 +01:00
Michael Niedermayer
1f686d023b avcodec/mpeg4videodec: Clear interlaced_dct for studio profile
Fixes: Out of array access
Fixes: 13090/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5408668986638336

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Kieran Kunhya <kierank@obe.tv>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-02-16 19:56:57 +01:00
Michael Niedermayer
074187d599 avcodec/mpeg4videodec: Clear partitioned frame in decode_studio_vop_header()
partitioned_frame is also set/cleared in decode_vop_header()

Fixes: out of array read
Fixes: 9789/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5638681627983872

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-11-04 20:21:24 +01:00
Michael Niedermayer
b737317a88 avcodec/mpeg4videodec: Fix typo in sprite delta check
Fixes: Integer overflow
Fixes: 10890/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5636062181851136

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-10-22 21:43:17 +02:00
Michael Niedermayer
c88afa44c4 avcodec/mpeg4videodec: Fix undefined shift in get_amv()
Fixes: runtime error: shift exponent -1 is negative
Fixes: 9938/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5653783529914368

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-09-19 23:08:31 +02:00
Michael Niedermayer
fb7b0347b3 avcodec/mpeg4videodec: Check rice_prefix_code
Fixes: out of array read
Fixes: 10064/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5766801384800256
Fixes: 10225/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5071833448054784
Fixes: 10261/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5115048024866816

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-09-19 23:08:23 +02:00
Kieran Kunhya
844ff49469 mpeg4video: Add Studio DPCM support 2018-08-25 22:08:19 +02:00
Michael Niedermayer
168d8d56bf avcodec/mpeg4videodec: Fix slice end detection in mpeg4_decode_studio_mb()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-25 18:50:30 +02:00
Michael Niedermayer
5aba5b89d0 avcodec/mpeg4videodec: Check for bitstream end in read_quant_matrix_ext()
Fixes: out of array read
Fixes: asff-crash-0e53d0dc491dfdd507530b66562812fbd4c36678

Found-by: Paul Ch <paulcher@icloud.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-07-04 23:14:24 +02:00
Michael Niedermayer
bd27a9364c avcodec/mpeg4videodec: Remove use of FF_PROFILE_MPEG4_SIMPLE_STUDIO as indicator of studio profile
The profile field is changed by code inside and outside the decoder,
its not a reliable indicator of the internal codec state.
Maintaining it consistency with studio_profile is messy.
Its easier to just avoid it and use only studio_profile

Fixes: assertion failure
Fixes: ffmpeg_crash_9.avi

Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-07-04 12:11:36 +02:00
Michael Niedermayer
2aa9047486 avcodec/mpeg4videodec: Check read profile before setting it
Fixes: null pointer dereference
Fixes: ffmpeg_crash_7.avi

Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-06-28 21:35:01 +02:00
Michael Niedermayer
2fc108f60f avcodec/mpeg4videodec: Clear bits_per_raw_sample if it has originated from a previous instance
Fixes: assertion failure
Fixes: ffmpeg_crash_5.avi

Found-by: Thuan Pham <thuanpv@comp.nus.edu.sg>, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-06-13 21:55:19 +02:00
Michael Niedermayer
ba97d75ac6 avcodec/mpeg4video: Detect reference studio streams as studio streams
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-05-17 02:23:06 +02:00
Michael Niedermayer
b3a18511cc avcodec/mpeg4videodec: Check bps (VOL header) before VOP for studio profile
Fixes: runtime error: shift exponent -1 is negative
Fixes: 7486/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-4977380939530240

Fixes: runtime error: index 36 out of bounds for type 'const uint8_t [32]'
Fixes: 7566/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-6536620682510336

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-05-17 02:23:06 +02:00
Michael Niedermayer
9e5d0860c0 avcodec/mpeg4videodec: Do not corrupt bits_per_raw_sample
Reviewed-by: Kieran Kunhya <kierank@obe.tv>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-05-17 02:23:06 +02:00
Michael Niedermayer
9f73ae31e0 avcodec/mpeg4videode: Eliminate out of loop VOP startcode reading for studio profile
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-05-17 02:23:06 +02:00
Michael Niedermayer
177133a0f4 avcodec/mpeg4videodec: Split decode_studio_vol_header() out of decode_studiovisualobject()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-05-03 17:33:51 +02:00
Michael Niedermayer
e03bf251d8 avcodec/mpeg4videodec: Move decode_studiovisualobject() parsing in the branch for visual object parsing
Fixes: runtime error: shift exponent -1 is negative
Fixes: 7510/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5024523356209152

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-05-03 17:33:51 +02:00
James Almer
2f27370111 avcodec/mpeg4videodec: unbreak multithreading decoding
Should fix double free related crashes.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-04 11:09:11 -03:00
James Almer
a866cc3ad3 avcodec/mpeg4videodec: free studio profile VLCs when closing the decoder
Fixes memleaks.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-04 00:45:16 -03:00
Kieran Kunhya
f9d3841ae6 mpeg4video: Add support for MPEG-4 Simple Studio Profile.
This is a profile supporting > 8-bit video and has a higher quality DCT
2018-04-02 13:06:23 +01:00
Michael Niedermayer
db77230894 avcodec/mpeg4videodec: Use more specific error codes
Forward error codes where possible.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-03-26 02:17:13 +02:00
Michael Niedermayer
63a4bdbf3b avcodec/mpeg4videodec: Ignore multiple VOL headers
Fixes: Ticket7005

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-02-11 12:06:04 +01:00
Michael Niedermayer
d4967c04e0 avcodec/mpeg4videodec: Avoid possibly aliasing violating casts
Found-by: kierank
Reviewed-by: Kieran Kunhya <kieran618@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-01-29 04:11:28 +01:00
Michael Niedermayer
05f4703a16 avcodec/mpeg4videodec: Check mb_num also against 0
The spec implies that 0 is invalid in addition to the existing checks

Found-by: <kierank>
Reviewed-by: Kieran Kunhya <kieran618@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-01-29 04:11:28 +01:00
Mark Thompson
e6a1dfc9ce mpeg4videodec: Fix unused variable warning
video_format is not used.
2017-12-26 17:25:46 +00:00
Michael Niedermayer
4b2a186ef0 avcodec/mpeg4videodec: Add support for parsing and exporting video_range
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-21 19:48:41 +01:00
James Almer
921d7af6e9 avcodec/mpeg4videodec: fix preprocessor check for the nvdec hwaccel
Signed-off-by: James Almer <jamrial@gmail.com>
2017-11-26 22:21:20 -03:00
Mark Thompson
758fbc54fe lavc: Add hardware config metadata for decoders supporting hardware output
This includes a pointer to the associated hwaccel for decoders using
hwaccels - these will be used later to implement the hwaccel setup
without needing a global list.

Also added is a new file listing all hwaccels as external declarations -
this will be used later to generate the hwaccel list at configure time.
2017-11-26 21:35:53 +00:00
Michael Niedermayer
0e7865ce41 avcodec/mpeg4videodec: Check also for negative versions in the validity check
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-11-21 21:24:08 +01:00
Dale Curtis
7010dd98b5 Fix undefined shift on assumed 8-bit input.
decode_user_data() attempts to create an integer |build|
value with 8 bits of spacing for 3 components. However
each component is an int32_t, so shifting each component
is undefined for values outside of the 8 bit range.

This patch simply clamps input to 8-bits per component
and prints out a warning that the values were clamped.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-11-21 03:13:03 +01:00
James Almer
e621b1ca64 Merge commit '97cfe1d8bd1968143e2ba9aa46ebe9504a835e24'
* commit '97cfe1d8bd1968143e2ba9aa46ebe9504a835e24':
  Convert all AVClass struct declarations to designated initializers.

Merged-by: James Almer <jamrial@gmail.com>
2017-11-01 20:05:09 -03:00
James Almer
af0505ed95 Merge commit '6ac0e7818399a57e4684202bac79f35b3561ad1e'
* commit '6ac0e7818399a57e4684202bac79f35b3561ad1e':
  mpeg4videodec: raise an error if sprite_trajectory.table is NULL

Merged-by: James Almer <jamrial@gmail.com>
2017-10-26 16:19:43 -03:00
James Almer
b773a8d8c1 Merge commit 'dd343fd986459f467a2d1d70c26101dff1d47d68'
* commit 'dd343fd986459f467a2d1d70c26101dff1d47d68':
  lavu: Drop deprecated VDPAU pixel formats

Merged-by: James Almer <jamrial@gmail.com>
2017-10-23 18:15:49 -03:00
Michael Niedermayer
e38f280fec avcodec/mpeg4videodec: Use 64 bit intermediates for sprite delta
Fixes: runtime error: signed integer overflow: -104713 * 65536 cannot be represented in type 'int'
Fixes: 3453/clusterfuzz-testcase-minimized-5555554657239040
Fixes: 3528/clusterfuzz-testcase-minimized-6283628420005888

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-10-10 23:58:40 +02:00