Commit Graph

7 Commits

Author SHA1 Message Date
Andreas Cadhalpun
30e6abd1a8 webp: ensure that each transform is only used once
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>
2015-03-19 21:03:13 +01:00
Andreas Cadhalpun
4f2ee9daee webp: validate the distance prefix code
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>
2015-03-05 14:49:16 +01:00
Justin Ruggles
c6698dfe7c webpdec: Fix decoding of the huffman group indices.
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."
2014-07-03 15:29:01 -04:00
Justin Ruggles
d085f80fa1 webp: add a special case for a huffman table with only 1 symbol
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.
2013-12-05 20:37:06 -05:00
Justin Ruggles
f51e3a1971 webp: do not call av_frame_free() on the user-provided frame
Fixes double-free on error.
2013-12-05 20:36:54 -05:00
Anton Khirnov
0a9e94bba8 webp: stop using deprecated avcodec_set_dimensions 2013-10-31 20:14:16 +01:00
Justin Ruggles
c4bfa09807 Add a WebP decoder
Container and lossy decoding by Aneesh Dogra <aneesh@sugarlabs.org>
Lossless decoding by Justin Ruggles <justin.ruggles@gmail.com>
2013-09-18 14:10:05 -04:00