[FFmpeg-trac] #9368(undetermined:new): Valid webp file fails to decode (color indexing + predictor transform)
FFmpeg
trac at avcodec.org
Mon Aug 9 13:23:20 EEST 2021
#9368: Valid webp file fails to decode (color indexing + predictor transform)
-------------------------------------+-------------------------------------
Reporter: marylauc | Type: defect
Status: new | Priority: normal
Component: | Version:
undetermined | unspecified
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Summary of the bug:
Webp images with 16 or fewer colors, that use a "color indexing" transform
followed by a predictor transform fail to decode.
With the attached example, the error produced is "Transform 3 used more
than once"
However, there are only two transforms. First a color indexing transform
(type 3) then a predictor transform (type 0).
Ffmpeg reads the data for the second transform incorrectly, which throws
off the rest of the parsing.
How to reproduce:
{{{
% ffmpeg -i cut_x_lef.webp cut_x_lef.png
ffmpeg version N-103193-gc60b76d0c8 Copyright (c) 2000-2021 the FFmpeg
developers
built with gcc 10 (Debian 10.2.1-6+build2)
configuration:
libavutil 57. 3.100 / 57. 3.100
libavcodec 59. 4.101 / 59. 4.101
libavformat 59. 4.101 / 59. 4.101
libavdevice 59. 0.100 / 59. 0.100
libavfilter 8. 1.103 / 8. 1.103
libswscale 6. 0.100 / 6. 0.100
libswresample 4. 0.100 / 4. 0.100
[webp @ 0x56107f3c0e80] Transform 3 used more than once
}}}
In images with 16 or fewer colors, a color indexing transform triggers
"pixel bundling", which "packs several (2, 4, or 8) pixels into a single
pixel, reducing the image width respectively."
This reduced width should be used for reading data for subsequent
transforms.
I believe that in webp.c, parse_transform_predictor should use
s->reduced_width instead of s->width if non zero. The same might be true
for parse_transform_color and decode_entropy_image as well.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/9368>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list