Opened 5 months ago
Last modified 5 months ago
#11012 new defect
APNG decoder incorrectly assumes fcTL chunk must be immediately followed by fdAT or IDAT
Reported by: | tobbez | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avformat |
Version: | git-master | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
The APNG decoder (more specifically apng_read_packet
in libavformat/apngdec.c) incorrectly assumes an fcTL
chunk must be immediately followed by either an fdAT
or an IDAT
chunk.
In addition, when the fdAT
/IDAT
check fails, the input stream is not rewinded to the start of the chunk that follows the fcTL
chunk, causing misleading log messages: "tag=ware (0x65726177) len=1399809652" in the output below ought to be "tag=tEXt (0x74584574) len=16".
An example file can be created using exiftool on an existing APNG file (exiftool -Software=example apng.png
). This produces a file where the first fcTL
chunk is followed by a tEXt
chunk. Such an example will be attached.
How to reproduce:
% ffmpeg -i example.png -f null /dev/null ffmpeg version N-115183-g02c032abcd Copyright (c) 2000-2024 the FFmpeg developers built with gcc 13 (13.2.1_p20240503 p15) configuration: libavutil 59. 17.100 / 59. 17.100 libavcodec 61. 5.103 / 61. 5.103 libavformat 61. 3.103 / 61. 3.103 libavdevice 61. 2.100 / 61. 2.100 libavfilter 10. 2.101 / 10. 2.101 libswscale 8. 2.100 / 8. 2.100 libswresample 5. 2.100 / 5. 2.100 [apng @ 0x55841a01a7c0] Could not find codec parameters for stream 0 (Video: apng, none, 64x64): unspecified pixel format Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options Input #0, apng, from 'example.png': Duration: N/A, bitrate: N/A Stream #0:0: Video: apng, none, 64x64, 100k tbr, 100k tbn Stream mapping: Stream #0:0 -> #0:0 (apng (native) -> wrapped_avframe (native)) Press [q] to stop, [?] for help [apng @ 0x55841a01a7c0] In-stream tag=ware (0x65726177) len=1399809652 is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. [apng @ 0x55841a01a7c0] If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org) [in#0/apng @ 0x55841a01a500] Error during demuxing: Not yet implemented in FFmpeg, patches welcome Cannot determine format of input 0:0 after EOF [vf#0:0 @ 0x55841a01cb80] Task finished with error code: -1094995529 (Invalid data found when processing input) [vf#0:0 @ 0x55841a01cb80] Terminating thread with return code -1094995529 (Invalid data found when processing input) [vost#0:0/wrapped_avframe @ 0x55841a01cfc0] Could not open encoder before EOF [vost#0:0/wrapped_avframe @ 0x55841a01cfc0] Task finished with error code: -22 (Invalid argument) [vost#0:0/wrapped_avframe @ 0x55841a01cfc0] Terminating thread with return code -22 (Invalid argument) [out#0/null @ 0x55841a01c940] Nothing was written into output file, because at least one of its streams received no packets. frame= 0 fps=0.0 q=0.0 Lsize= 0KiB time=N/A bitrate=N/A speed=N/A Conversion failed!
Attachments (1)
Change History (2)
by , 5 months ago
Attachment: | example.png added |
---|
comment:1 by , 5 months ago
Version: | unspecified → git-master |
---|