#9368 closed defect (fixed)
Valid webp file fails to decode (color indexing + predictor transform)
Reported by: | marylauc | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avcodec |
Version: | git-master | Keywords: | webp |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
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.
Attachments (1)
Change History (3)
by , 3 years ago
Attachment: | cut_x_lef.webp added |
---|
comment:1 by , 3 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
This was fixed with:
9f4708c22def8a0f13c3b2bc39baca928bb58aaa webp: fix transforms after a palette with pixel packing.
The addition of a sample for fate is still pending.
comment:2 by , 2 years ago
Component: | undetermined → avcodec |
---|---|
Keywords: | webp added |
Version: | unspecified → git-master |
valid webp file failing to decode