summaryrefslogtreecommitdiff
path: root/libavcodec/vc1dec.c
Commit message (Collapse)AuthorAge
* avcodec/vc1dec: return value check for init_get_bitsmaryam ebrahimzadeh2021-08-26
| | | | | | As the second argument for init_get_bits(avctx and buf) can be crafted, a return value check for this function call is necessary, so replace init_get_bits with init_get_bits8 and add return value check.
* avcodec/vc1dec: ff_print_debug_info() does not support WMV3 field_modeMichael Niedermayer2021-08-22
| | | | | | | | Fixes: out of array read Fixes: 36331/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV3_fuzzer-5140494328922112.fuzz Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vc1dec: Disable error concealment for *IMAGEMichael Niedermayer2021-08-10
| | | | | | | | | | | | | | The existing error concealment makes no sense for the image formats, they use transformed source images which is different from keyframe + MC+difference for which the error concealment is designed. Of course feel free to re-enable this if you have a case where it works and improves vissual results Fixes: Timeout Fixes: 36234/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-6300306743885824 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: Constify AVCodecsAndreas Rheinhardt2021-04-27
| | | | | | | | | | Given that the AVCodec.next pointer has now been removed, most of the AVCodecs are not modified at all any more and can therefore be made const (as this patch does); the only exceptions are the very few codecs for external libraries that have a init_static_data callback. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/vc1: Remove unused hrd fieldsAndreas Rheinhardt2021-04-12
| | | | | | Unused since be3492ec7eb2dbb0748c123af911a06c125c90db. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vc1: Don't pretend ff_vc1_init_common() can failAndreas Rheinhardt2021-04-12
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/vc1dec: Fix memleak upon allocation errorAndreas Rheinhardt2021-04-08
| | | | | | | | | | ff_vc1_decode_init_alloc_tables() had one error path that forgot to free already allocated buffers; these would then be overwritten on the next allocation attempt (or they would just not be freed in case this happened during init, as the decoders for which it is used do not have the FF_CODEC_CAP_INIT_CLEANUP set). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vc1dec: Postpone allocating sprite frame to avoid segfaultAndreas Rheinhardt2021-03-25
| | | | | | | | | | | | | | Up until now, the VC-1 decoders allocated an AVFrame for usage with sprites during vc1_decode_init(); yet said AVFrame can be freed if (re)initializing the context (which happens ordinarily during decoding) fails. The AVFrame does not get allocated again lateron in this case, leading to segfaults. Fix this by moving the allocation of said frame immediately before it is used (this also means that said frame won't be allocated at all any more in case of a regular (i.e. non-image) stream). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* Mark some pointers as constAndreas Rheinhardt2021-01-01
| | | | | Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* lavc: Rename hwaccel.h to hwconfig.hMark Thompson2020-04-26
| | | | | This already applied to decoders as well as hwaccels, and adding encoder support was going to make the name even more inaccurate.
* avcodec/vc1dec: Allocate only as much space as is unescapedMichael Niedermayer2020-01-18
| | | | | | | | | Fixes: OOM Fixes: 18137/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5723834900021248 Fixes: 20037/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5683758976204800 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec/vc1: Remove bits variableMichael Niedermayer2020-01-11
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vc1dec: Check field_mode for spritesMichael Niedermayer2020-01-11
| | | | | | | | Fixes: Out of array read Fixes: 19263/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5389219325542400 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vc1dec: Limit bits by the actual bitstream sizeMichael Niedermayer2020-01-11
| | | | | | | | Fixes: Timeout (350 ->19sec) Fixes: 19249/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-6566896438870016 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vc1dec: Fix "return -1" casesMichael Niedermayer2019-12-28
| | | | | Reviewed-by: "mypopy@gmail.com" <mypopy@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vc1dec: Free sprite_output_frame on errorMichael Niedermayer2019-12-28
| | | | | | | | Fixes: memleaks Fixes: 19471/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5688035714269184 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vc1dec: remove the unneeded ()Limin Wang2019-12-26
| | | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vc1dec: Require res_sprite for wmv3imagesMichael Niedermayer2019-08-31
| | | | | | | | | | | non res_sprite leads to decoder delay which leads to assertion failure Fixes: Assertion failure Fixes: 16402/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV3IMAGE_fuzzer-5704510034411520 Fixes: left shift of 1073741824 by 1 places cannot be represented in type 'int' Fixes: 16425/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV3IMAGE_fuzzer-5692858838810624 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vc1: fix check for missing CBPTABJerome Borsboom2018-06-29
| | | | | | CBPTAB must be present in (non skipped) P and B pictures. Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
* avcodec/vc1: support multi-slice field interlaced pictures with hwaccelJerome Borsboom2018-06-17
| | | | | | | | | When using hardware accelerated decoding for multi-slice field interlaced pictures, only the first slice was decoded. This patch adds the neccesary looping over the remaining slices that may exist in field interlaced pictures. Additionally, we align the calculation of mby_start for the second field with the method given in VC-1 spec. Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
* avcodec/vc1: fix calculation of the last line of a sliceJerome Borsboom2018-05-20
| | | | | | | | Only for the last slice of the first field is the last line of the slice equal to the height of the field. Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vc1: store additional bitstream elements during MB decodingJerome Borsboom2018-04-25
| | | | | | | The new loop filter needs additional MB properties to make its filtering decisions. Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
* avcodec/vc1dec: fix preprocessor checks and hw_configs lists for the hwaccelsJames 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: Implement vc1 nvdec hwaccelPhilip Langdale2017-11-14
| | | | | This hwaccel is interesting because it also works for wmv3/9 content, which is not supported by the nvidia parser used by cuviddec.
* Merge commit 'dd343fd986459f467a2d1d70c26101dff1d47d68'James Almer2017-10-23
|\ | | | | | | | | | | | | * commit 'dd343fd986459f467a2d1d70c26101dff1d47d68': lavu: Drop deprecated VDPAU pixel formats Merged-by: James Almer <jamrial@gmail.com>
| * lavc: Remove deprecated XvMC support hacksDiego Biurrun2017-03-23
| | | | | | | | Deprecated in 11/2013.
* | Merge commit '7b917041184874e7d7cba4450813de7e0bb28a33'James Almer2017-10-21
|\| | | | | | | | | | | | | * commit '7b917041184874e7d7cba4450813de7e0bb28a33': lavc: Drop deprecated VDPAU codec capability Merged-by: James Almer <jamrial@gmail.com>
| * vc1: check that slices have a positive heightAnton Khirnov2016-08-18
| | | | | | | | | | | | | | Fixes possible invalid reads. CC: libav-stable@libav.org Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
* | dxva: add support for new dxva2 and d3d11 hwaccel APIswm42017-06-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also adds support to avconv (which is trivial due to the new hwaccel API being generic enough). The new decoder setup code in dxva2.c is significantly based on work by Steve Lhomme <robux4@gmail.com>, but with heavy changes/rewrites. Merges Libav commit f9e7a2f95a7194a8736cc1416a03a1a0155a3e9f. Also adds untested VP9 support. The check for DXVA2 COBJs is removed. Just update your MinGW to something newer than a 5 year old release. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | vc1dec: support multiple slices in frame coded images with hwaccelHendrik Leppkes2016-11-26
| | | | | | | | Based on a patch by Jun Zhao <mypopydev@gmail.com>
* | 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>
* | Merge commit 'ca8c7591735c0f80cc29e31e2e92cb10228e14c7'Derek Buitenhuis2016-05-07
|\| | | | | | | | | | | | | * commit 'ca8c7591735c0f80cc29e31e2e92cb10228e14c7': intrax8: Remove mpegvideo dependency Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * intrax8: Remove mpegvideo dependencyVittorio Giovara2016-03-29
| |
* | Merge commit '9fa888c02801fff2e8817c24068f5296bbe60000'Derek Buitenhuis2016-05-07
|\| | | | | | | | | | | | | * commit '9fa888c02801fff2e8817c24068f5296bbe60000': intrax8: Keep a reference to the decoder blocks Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * intrax8: Keep a reference to the decoder blocksVittorio Giovara2016-03-29
| |
* | Merge commit 'd0540fd02171a6233d2016b199d013299debf7e3'Derek Buitenhuis2016-05-07
|\| | | | | | | | | | | | | * commit 'd0540fd02171a6233d2016b199d013299debf7e3': intrax8: Pass macroblock size to ff_intrax8_common_init Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * intrax8: Pass macroblock size to ff_intrax8_common_initVittorio Giovara2016-03-29
| | | | | | | | Helps in decoupling this code from mpegvideo.
* | Merge commit '1eaae7abb8f208fefb4e8b9e983e61b2499206a3'Derek Buitenhuis2016-04-24
|\| | | | | | | | | | | | | * commit '1eaae7abb8f208fefb4e8b9e983e61b2499206a3': intrax8: Reference the current AVCodecContext Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * intrax8: Reference the current AVCodecContextVittorio Giovara2016-03-25
| | | | | | | | It will be needed to initialize BlockDSP in the next commit.
* | Merge commit '68127e1bf8037a6e0acd6401cc8c5da950e3fa0a'Derek Buitenhuis2016-04-24
|\| | | | | | | | | | | | | * commit '68127e1bf8037a6e0acd6401cc8c5da950e3fa0a': intrax8: Keep a reference to the context idctdsp Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * intrax8: Keep a reference to the context idctdspVittorio Giovara2016-03-25
| | | | | | | | | | Use it instead of the embedded mpegvideo one. Update init function signature to load it directly from the callers.
* | Merge commit 'd909f43b5c773a73c8d526638744547ba4aa8c59'Derek Buitenhuis2016-04-17
|\| | | | | | | | | | | | | * commit 'd909f43b5c773a73c8d526638744547ba4aa8c59': vc1dec: wmv2dec: Validate ff_intrax8_common_init return value Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * vc1dec: wmv2dec: Validate ff_intrax8_common_init return valueVittorio Giovara2016-03-22
| |
| * lavu: deprecate AV_PIX_FMT_VAAPI_*, replace with AV_PIX_FMT_VAAPIMark Thompson2016-03-19
| | | | | | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | Merge commit 'e66fa35392cd45d0a80774cd057fb765d60def43'Derek Buitenhuis2016-04-11
|\| | | | | | | | | | | | | * commit 'e66fa35392cd45d0a80774cd057fb765d60def43': vc1dec: Check group allocations separatedly Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * vc1dec: Check group allocations separatedlyVittorio Giovara2016-02-25
| | | | | | | | This avoids accessing NULL pointers in case of error.
| * vc1dec: Fix leak on error for array allocationsVittorio Giovara2016-02-25
| | | | | | | | | | The deinit function in the 'error' section will correctly free everything.
* | Merge commit 'f91d94bdfc3f5f83ff0be4d19d10d0a35697386f'Derek Buitenhuis2016-04-11
|\| | | | | | | | | | | | | * commit 'f91d94bdfc3f5f83ff0be4d19d10d0a35697386f': vc1dec: Properly call deinit function on error Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>