summaryrefslogtreecommitdiff
path: root/libavcodec/webp.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/webp: Check available space in loop in decode_entropy_coded_image()Michael Niedermayer2021-10-061-0/+3
| | | | | | | | | | Fixes: Timeout Fixes: 35401/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WEBP_fuzzer-5714401821851648 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 5e00eab61112c52f27a09fe77d50e6fc508f9c53) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* vp8: Add hwaccel hooksMark Thompson2017-11-261-0/+1
| | | | | | | | | | Also adds some extra fields to the main context structure that may be needed by a hwaccel decoder. The current behaviour of the WebP decoder is maintained by adding an additional field to the VP8 decoder private context to indicate that it is actually being used as WebP (no hwaccel is supported for that case).
* avcodec/exif: remove GetByteContext usage from avpriv_exif_decode_ifd()James Almer2017-10-261-1/+1
| | | | | | | This prevents potential ABI issues with GetByteContext. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/webp: add support for ICCP chunksJames Almer2017-07-261-2/+24
| | | | | | | Export the raw data as ICC Profile frame side data. Reviwed-by: Rostislav Pehlivanov <atomnuker@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/webp: Fixes null pointer dereferenceMichael Niedermayer2017-05-281-0/+3
| | | | | | | | | | | Fixes: 1470/clusterfuzz-testcase-minimized-5404421666111488 Fixes: 1472/clusterfuzz-testcase-minimized-5677426430443520 Fixes: 1875/clusterfuzz-testcase-minimized-5536474562822144 Approved-by: BBB Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/webp: Fix signedness in prefix_code checkMichael Niedermayer2017-05-131-1/+1
| | | | | | | | Fixes: out of array read Fixes: 1557/clusterfuzz-testcase-minimized-6535013757616128 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/webp: Add missing input paddingMichael Niedermayer2017-05-131-1/+1
| | | | | | | Fixes: 1536/clusterfuzz-testcase-minimized-5973925404082176 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/webp: Always set pix_fmtMichael Niedermayer2017-05-101-2/+1
| | | | | | | | | | Fixes: out of array access Fixes: 1434/clusterfuzz-testcase-minimized-6314998085189632 Fixes: 1435/clusterfuzz-testcase-minimized-6483783723253760 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/webp: Update canvas size in vp8_lossy_decode_frame() as in ↵Michael Niedermayer2017-05-091-0/+3
| | | | | | | | | | vp8_lossless_decode_frame() Fixes: 1407/clusterfuzz-testcase-minimized-6044604124102656 Fixes: 1420/clusterfuzz-testcase-minimized-6059927359455232 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/webp: Factor update_canvas_size() outMichael Niedermayer2017-05-091-10/+17
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/webp: Check for VP8X after other VP8 chunksMichael Niedermayer2017-05-091-0/+4
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/webp: Fix null pointer dereferenceMichael Niedermayer2017-05-061-0/+2
| | | | | | | Fixes: 1369/clusterfuzz-testcase-minimized-5048908029886464 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: do not use AVFrame accessorMuhammad Faiz2017-04-231-1/+1
| | | | | Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
* Merge commit 'b668662939de3a02454cfc9ba3e6d10b87527a40'Clément Bœsch2016-06-291-2/+3
|\ | | | | | | | | | | | | | | | | | | * commit 'b668662939de3a02454cfc9ba3e6d10b87527a40': get_bits: Move BITSTREAM_READER_LE definition before all relevant #includes The merge commit also includes changes for libavcodec/interplayacm.c and libavcodec/truemotion2rt.c Merged-by: Clément Bœsch <clement@stupeflix.com>
| * get_bits: Move BITSTREAM_READER_LE definition before all relevant #includesDiego Biurrun2016-06-071-2/+3
| | | | | | | | | | | | | | This avoids the danger that get_bits.h might get indirectly #included before BITSTREAM_READER_LE is defined. Also sort headers into canonical order where appropriate.
* | lavc/webp: Print a warning for unsupported chunks.Carl Eugen Hoyos2016-04-171-1/+1
| |
* | avcodec/webp: move exif_metadata outside of WebPContextJames Almer2016-02-211-5/+4
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* | Merge commit 'def97856de6021965db86c25a732d78689bd6bb0'Michael Niedermayer2015-07-271-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'def97856de6021965db86c25a732d78689bd6bb0': lavc: AV-prefix all codec capabilities Conflicts: cmdutils.c ffmpeg.c ffplay.c libavcodec/8svx.c libavcodec/aacenc.c libavcodec/ac3dec.c libavcodec/adpcm.c libavcodec/alac.c libavcodec/atrac3plusdec.c libavcodec/bink.c libavcodec/dnxhddec.c libavcodec/dvdec.c libavcodec/dvenc.c libavcodec/ffv1dec.c libavcodec/ffv1enc.c libavcodec/fic.c libavcodec/flacdec.c libavcodec/flacenc.c libavcodec/flvdec.c libavcodec/fraps.c libavcodec/frwu.c libavcodec/gifdec.c libavcodec/h261dec.c libavcodec/hevc.c libavcodec/iff.c libavcodec/imc.c libavcodec/libopenjpegdec.c libavcodec/libvo-aacenc.c libavcodec/libvorbisenc.c libavcodec/libvpxdec.c libavcodec/libvpxenc.c libavcodec/libx264.c libavcodec/mjpegbdec.c libavcodec/mjpegdec.c libavcodec/mpegaudiodec_float.c libavcodec/msmpeg4dec.c libavcodec/mxpegdec.c libavcodec/nvenc_h264.c libavcodec/nvenc_hevc.c libavcodec/pngdec.c libavcodec/qpeg.c libavcodec/ra288.c libavcodec/rv10.c libavcodec/s302m.c libavcodec/sp5xdec.c libavcodec/takdec.c libavcodec/tiff.c libavcodec/tta.c libavcodec/utils.c libavcodec/v210dec.c libavcodec/vp6.c libavcodec/vp9.c libavcodec/wavpack.c libavcodec/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * lavc: AV-prefix all codec capabilitiesVittorio Giovara2015-07-271-1/+1
| | | | | | | | | | | | Express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * webp: Make sure enough bytes are availableAndreas Cadhalpun2015-07-031-1/+1
| | | | | | | | | | | | | | | | Every chunk needs at least 8 bytes for chunk_type and chunk_size. Prevent a possible infinite loop. CC: libav-stable@libav.org Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
| * webp: ensure that each transform is only used onceAndreas Cadhalpun2015-03-191-1/+9
| | | | | | | | | | | | | | | | | | | | | | According to the WebP Lossless Bitstream Specification "each transform is allowed to be used only once". If a transform is more than once this can lead to memory corruption. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
| * webp: validate the distance prefix codeAndreas Cadhalpun2015-03-051-0/+5
| | | | | | | | | | | | | | | | | | | | | | According to the WebP Lossless Bitstream Specification the highest allowed value for a prefix code is 39. If prefix_code is too large, the calculated extra_bits has an invalid value and triggers an assertion in get_bits. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | lavc: Add properties field to AVCodecContext.Carl Eugen Hoyos2015-07-161-0/+1
| | | | | | | | The new field can hold information about losslessness and closed captions for now.
* | webp: fix infinite loop in webp_decode_frameAndreas Cadhalpun2015-07-031-1/+1
| | | | | | | | | | | | | | | | | | The loop always needs at least 8 bytes for chunk_type and chunk_size. If fewer are left, bytestream2_get_le32 just returns 0 without reading any bytes, leading to an infinite loop. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | webp: ensure that each transform is only used onceAndreas Cadhalpun2015-03-061-1/+9
| | | | | | | | | | | | | | | | | | | | According to the WebP Lossless Bitstream Specification "each transform is allowed to be used only once". If a transform is more than once this can lead to memory corruption. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/webp: validate the distance prefix codeAndreas Cadhalpun2015-03-031-0/+5
| | | | | | | | | | | | | | | | | | | | | | According to the WebP Lossless Bitstream Specification the highest allowed value for a prefix code is 39. If prefix_code is too large, the calculated extra_bits has an invalid value and triggers an assertion in get_bits. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/webp: use init_get_bits8()Paul B Mahol2015-02-041-1/+1
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avcodec/webp: add assert to ensure palette is not larger than 256Michael Niedermayer2014-10-051-0/+1
| | | | | | | | | | | | | | it should not be possible to be larger as its stored as 8bit value but we would be overwriting a stack buffer if it is ... Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/webp: add optimization: use local palette with extra paddingPascal Massimino2014-10-051-9/+25
| | | | | | | | | | | | for big enough pictures. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/webp: fix default palette color 0xff000000 -> 0x00000000Pascal Massimino2014-09-231-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | libavcodec/webp: treat out-of-bound palette index as translucent blackPascal Massimino2014-09-191-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | See https://code.google.com/p/webp/issues/detail?id=206 for a description of the problem/fix. Signed-off-by: Michael Niedermayer <michaelni@gmx.at> This patch makes the decoder follow the recommendation of the spec. There is some disagreement (see "[FFmpeg-devel] [PATCH]: libavcodec/webp") about what would be best to be written in the spec, so in case the spec is changed again, this potentially would need to be amended or reverted
* | Merge commit 'c6698dfe7cdbc7634f33245875488ed3fa4a8ced'Michael Niedermayer2014-07-041-2/+6
|\ \ | |/ | | | | | | | | | | * commit 'c6698dfe7cdbc7634f33245875488ed3fa4a8ced': webpdec: Fix decoding of the huffman group indices. Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * webpdec: Fix decoding of the huffman group indices.Justin Ruggles2014-07-031-2/+6
| | | | | | | | | | | | Per the specification, "The red and green components of a pixel define the meta Huffman code used in a particular block of the ARGB image."
* | avcdoec/webp: use av_malloc_array()Michael Niedermayer2014-04-201-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavc/exif: Make EXIF IFD decoding part of private API/ABI.Thilo Borgmann2014-04-051-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | webp: fix capitalization of the word ExifJames Almer2014-01-151-5/+5
| | | | | | | | | | | | | | Also remove "webp:" from log messages. Using the AVCodecContext is enough. Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | webp: add support for EXIF metadata chunksJames Almer2014-01-141-2/+44
| | | | | | | | | | | | | | Based on mjpeg code by Thilo Borgmann Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-12-061-1/+17
|\ \ | |/ | | | | | | | | | | * qatar/master: webp: add a special case for a huffman table with only 1 symbol Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * webp: add a special case for a huffman table with only 1 symbolJustin Ruggles2013-12-051-1/+17
| | | | | | | | | | | | | | | | | | The vlc reader cannot handle 0-bit huffman codes. For most situations WebP uses the "simple" huffman coding for this case, but that will only handle symbols up to 255. For the LZ77 distance codes, larger symbol values are needed, so it can happen in rare cases that a normal huffman table is used that only has a single symbol.
* | Merge commit 'f51e3a1971045c7ed0c3d9d29d3254a4d940198e'Michael Niedermayer2013-12-061-6/+2
|\ \ | |/ | | | | | | | | | | * commit 'f51e3a1971045c7ed0c3d9d29d3254a4d940198e': webp: do not call av_frame_free() on the user-provided frame Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * webp: do not call av_frame_free() on the user-provided frameJustin Ruggles2013-12-051-6/+2
| | | | | | | | Fixes double-free on error.
* | Merge commit '0a9e94bba8f8a40156438a43e4fe0e9ae36236cb'Michael Niedermayer2013-11-011-2/+2
|\ \ | |/ | | | | | | | | | | * commit '0a9e94bba8f8a40156438a43e4fe0e9ae36236cb': webp: stop using deprecated avcodec_set_dimensions Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * webp: stop using deprecated avcodec_set_dimensionsAnton Khirnov2013-10-311-2/+2
| |
* | Merge commit 'c4bfa098072ba338d83555d6e2199f7e1e64ffff'Michael Niedermayer2013-09-191-4/+4
|/ | | | | | | | | | | | | | | | | | * commit 'c4bfa098072ba338d83555d6e2199f7e1e64ffff': Add a WebP decoder Conflicts: Changelog doc/general.texi libavcodec/Makefile libavcodec/avcodec.h libavcodec/version.h libavformat/img2.c The previously existing webp decoder is disabled as the new one supports lossless mode and alpha while the previous does not. Merged-by: Michael Niedermayer <michaelni@gmx.at>
* Add a WebP decoderJustin Ruggles2013-09-181-0/+1455
Container and lossy decoding by Aneesh Dogra <aneesh@sugarlabs.org> Lossless decoding by Justin Ruggles <justin.ruggles@gmail.com>