summaryrefslogtreecommitdiff
path: root/libavcodec/mpeg4videodec.c
Commit message (Collapse)AuthorAge
* avcodec/mpeg4videodec: Use more specific error codesMichael Niedermayer2018-03-26
| | | | | | Forward error codes where possible. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpeg4videodec: Ignore multiple VOL headersMichael Niedermayer2018-02-11
| | | | | | Fixes: Ticket7005 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpeg4videodec: Avoid possibly aliasing violating castsMichael Niedermayer2018-01-29
| | | | | | Found-by: kierank Reviewed-by: Kieran Kunhya <kieran618@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpeg4videodec: Check mb_num also against 0Michael Niedermayer2018-01-29
| | | | | | | | 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>
* mpeg4videodec: Fix unused variable warningMark Thompson2017-12-26
| | | | video_format is not used.
* avcodec/mpeg4videodec: Add support for parsing and exporting video_rangeMichael Niedermayer2017-12-21
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpeg4videodec: fix preprocessor check for the nvdec hwaccelJames Almer2017-11-26
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* lavc: Add hardware config metadata for decoders supporting hardware outputMark Thompson2017-11-26
| | | | | | | | | 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.
* avcodec/mpeg4videodec: Check also for negative versions in the validity checkMichael Niedermayer2017-11-21
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Fix undefined shift on assumed 8-bit input.Dale Curtis2017-11-21
| | | | | | | | | | | | | 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>
* Merge commit '97cfe1d8bd1968143e2ba9aa46ebe9504a835e24'James Almer2017-11-01
|\ | | | | | | | | | | | | * commit '97cfe1d8bd1968143e2ba9aa46ebe9504a835e24': Convert all AVClass struct declarations to designated initializers. Merged-by: James Almer <jamrial@gmail.com>
* | Merge commit '6ac0e7818399a57e4684202bac79f35b3561ad1e'James Almer2017-10-26
|\| | | | | | | | | | | | | * commit '6ac0e7818399a57e4684202bac79f35b3561ad1e': mpeg4videodec: raise an error if sprite_trajectory.table is NULL Merged-by: James Almer <jamrial@gmail.com>
| * mpeg4videodec: raise an error if sprite_trajectory.table is NULLSean McGovern2017-04-05
| | | | | | | | | | CC: libav-stable@libav.org Bug-Id: 1012
* | Merge commit 'dd343fd986459f467a2d1d70c26101dff1d47d68'James Almer2017-10-23
|\| | | | | | | | | | | | | * commit 'dd343fd986459f467a2d1d70c26101dff1d47d68': lavu: Drop deprecated VDPAU pixel formats Merged-by: James Almer <jamrial@gmail.com>
| * Mark some arrays that never change as const.Anton Khirnov2017-02-01
| |
| * mpeg4videodec: Call av_log() in check_marker() with AVCodecContext instead ↵Alexandra Hájková2016-05-16
| | | | | | | | | | | | of NULL Signed-off-by: Anton Khirnov <anton@khirnov.net>
| * Move check_marker() from get_bits to mpeg4videodecAlexandra Hájková2016-05-16
| | | | | | | | | | | | MPEG-4 is the only decoder which uses check_marker(). Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | avcodec/mpeg4videodec: Use 64 bit intermediates for sprite deltaMichael Niedermayer2017-10-10
| | | | | | | | | | | | | | | | | | 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>
* | avcodec/mpeg4videodec: Clear mcsel before decoding an imageMichael Niedermayer2017-08-11
| | | | | | | | | | | | | | | | Fixes: runtime error: signed integer overflow: 2146467840 + 1032192 cannot be represented in type 'int' Fixes: 2826/clusterfuzz-testcase-minimized-5901511613743104 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpeg4videodec: Fix GMC with videos of dimension 1Michael Niedermayer2017-06-24
| | | | | | | | | | | | | | | | Fixes: runtime error: shift exponent -1 is negative Fixes: 2338/clusterfuzz-testcase-minimized-5153426541379584 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpeg4videodec: Fix overflow in virtual_ref computationMichael Niedermayer2017-06-21
| | | | | | | | | | | | | | | | Fixes: runtime error: signed integer overflow: 262144 * -16120 cannot be represented in type 'int' Fixes: 2292/clusterfuzz-testcase-minimized-6156080415506432 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpeg4videodec: Check sprite delta upshift against overflowing.Michael Niedermayer2017-06-15
| | | | | | | | | | | | | | | | Fixes: runtime error: signed integer overflow: -268386304 * 16 cannot be represented in type 'int' Fixes: 2204/clusterfuzz-testcase-minimized-5616756909408256 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpeg4videodec: Fix integer overflow in num_sprite_warping_points=2 caseMichael Niedermayer2017-06-15
| | | | | | | | | | | | | | | | Fixes: runtime error: signed integer overflow: 131072 + 2147352576 cannot be represented in type 'int' Fixes: 2192/clusterfuzz-testcase-minimized-5370387988742144 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpeg4videodec: Fix runtime error: signed integer overflow: 53098 * ↵Michael Niedermayer2017-06-06
| | | | | | | | | | | | | | | | | | 40448 cannot be represented in type 'int' Fixes: 2106/clusterfuzz-testcase-minimized-6136503639998464 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpeg4videodec: Check for multiple VOL headersMichael Niedermayer2017-05-21
| | | | | | | | | | | | | | | | | | | | Fixes multiple: runtime error: signed integer overflow: 2147115008 + 413696 cannot be represented in type 'int' Fixes: 1723/clusterfuzz-testcase-minimized-5309409372667904 Fixes: 1727/clusterfuzz-testcase-minimized-5900685306494976 Fixes: 1737/clusterfuzz-testcase-minimized-5922321338466304 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpeg4videodec: Clear sprite wraping on unsupported cases in VOP decodeMichael Niedermayer2017-05-14
| | | | | | | | | | | | | | | | Fixes: Integer overflow Fixes: 1572/clusterfuzz-testcase-minimized-4578773729017856 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | libavcodec/mpeg4videodec: Convert sprite_offset to 64bitMichael Niedermayer2017-05-04
| | | | | | | | | | | | | | | | | | | | This avoids intermediates from overflowing (the final values are checked) Fixes: runtime error: signed integer overflow: -167712 + -2147352576 cannot be represented in type 'int' Fixes: 1298/clusterfuzz-testcase-minimized-5955580877340672 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpeg4videodec: Fix runtime error: signed integer overflow: ↵Michael Niedermayer2017-03-09
| | | | | | | | | | | | | | | | | | -135088512 * 16 cannot be represented in type 'int' Fixes: 736/clusterfuzz-testcase-5580263943831552 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpeg4videodec: Fix runtime error: signed integer overflow: 134527392 ↵Michael Niedermayer2017-03-05
| | | | | | | | | | | | | | | | | | | | * 16 cannot be represented in type 'int' This checks the sprite delta intermediates for overflow Fixes: 716/clusterfuzz-testcase-4890287480504320 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpeg4videodec: Improve the overflow checks in ↵Michael Niedermayer2017-03-04
| | | | | | | | | | | | | | | | | | | | | | mpeg4_decode_sprite_trajectory() Also clear the state on errors Fixes integer overflows in 701/clusterfuzz-testcase-6594719951880192 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpeg4videodec: Fix runtime error: left shift of negative value -2650Michael Niedermayer2017-02-28
| | | | | | | | | | | | | | Fixes: 674/clusterfuzz-testcase-6713275880308736 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpeg4videodec: Check the other 3 sprite points for intermediate ↵Michael Niedermayer2017-02-24
| | | | | | | | | | | | | | | | | | | | | | | | | | overflows This is not necessarily specific to fuzzed files Fixes: Multiple integer overflows Fixes: 656/clusterfuzz-testcase-6463814516080640 Fixes: 658/clusterfuzz-testcase-6691260146384896 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpeg4videodec: Check sprite_offset in addition to shiftsMichael Niedermayer2017-02-22
| | | | | | | | | | | | | | Fixes: 651/clusterfuzz-testcase-5710668915277824 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpeg4video: Fix runtime error: left shift of negative valueMichael Niedermayer2017-02-22
| | | | | | | | | | | | Fixes: 644/clusterfuzz-testcase-4726434209726464 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpeg4videodec: Fix runtime error: shift exponent -2 is negativeMichael Niedermayer2017-02-19
| | | | | | | | | | | | | | Fixes: 612/clusterfuzz-testcase-4707817137111040 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec: Add FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM to most h263 based codecsMichael Niedermayer2017-01-21
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpeg4videodec: Fix undefined shifts in mpeg4_decode_sprite_trajectory()Michael Niedermayer2016-12-09
| | | | | | | | | | | | | | Fixes: part of 670190.ogg Found-by: Matt Wolenetz <wolenetz@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpeg4videodec: Workaround interlaced mpeg4 edge MC bugMichael Niedermayer2016-11-17
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavc/get_bits: add a logging context to check_marker()Clément Bœsch2016-06-22
| | | | | | | | Based on d338abb664febbc2c7266af7818aab1f12dbc161
* | Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'Clément Bœsch2016-06-21
|\| | | | | | | | | | | | | * commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb': cosmetics: Fix spelling mistakes Merged-by: Clément Bœsch <u@pkh.me>
| * cosmetics: Fix spelling mistakesVittorio Giovara2016-05-04
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | avcodec/mpeg4videodec: Fix default low_delay flag value if not codedMichael Niedermayer2016-06-05
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mpeg4videodec: Print low_delay value with -debug 1 in ↵Michael Niedermayer2016-06-05
| | | | | | | | | | | | decode_vol_header() Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | mpeg4videodec: silence ubsan warningAndreas Cadhalpun2016-01-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | s->ac_val[0][0] is of type 'int16_t [16]', but points into a larger buffer. Here it is used as base pointer to find the correct position in the larger buffer by adding 's->block_index[n] * 16' and thus as 'int16_t *'. This fixes clang's ubsan runtime error: index out of bounds for type 'int16_t [16]' Fixes: test_case.mp4 Found-by: Tyson Smith <twsmith@mozilla.com> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | Merge commit '2c6811397bdf13d43ca206e48d6d6da9c2cd47c6'Hendrik Leppkes2016-01-01
|\| | | | | | | | | | | | | * commit '2c6811397bdf13d43ca206e48d6d6da9c2cd47c6': lavc: add profiles to AVCodecDescriptor Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavc: add profiles to AVCodecDescriptorAnton Khirnov2015-12-12
| | | | | | | | | | The profiles are a property of the codec, so it makes sense to export them through AVCodecDescriptors, not just the codec implementations.
| * lavc: Consistently prefix input buffer definesVittorio Giovara2015-07-27
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avcodec/mpeg4videodec: also for empty partitioned slicesMichael Niedermayer2015-12-19
| | | | | | | | | | | | | | | | Fixes assertion failure Fixes: id_acf3e47f864e1ee4c7b86c0653e0ff31e5bde56e.m4v Found-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec: use AV_OPT_TYPE_BOOL in a bunch of placesClément Bœsch2015-12-04
| |
* | avcodec/mpeg4videodec: Check available data before reading custom matrixMichael Niedermayer2015-11-29
| | | | | | | | | | | | | | | | Fixes: out of array read Fixes: 76c515fc3779d1b838667c61ea13ce92/asan_heap-oob_1fc0d07_8913_794a4629a264ebdb25b58d3a94ed1785.bit Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>