]> git.sesse.net Git - ffmpeg/commit
avformat/apngdec: Return error for incomplete header
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 10 Dec 2019 10:47:57 +0000 (11:47 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 3 Nov 2020 13:27:25 +0000 (14:27 +0100)
commit2cf1eefae5dba7a7259156f9ff5c62f4e4e2fe0d
treec4693ff4fa9f0acd57b6a820ffd8a7786dbfcd80
parent112fe0ff194ffe7670fbc0690e6b15ba6279e11a
avformat/apngdec: Return error for incomplete header

If avio_read() could read anything, it returns the number of bytes read,
even if it could not read as much as the caller desired.
apng_read_header() only checked the return value of its avio_read() calls
for being negative and this meant that it was possible for an incomplete
header to not be detected. The return value of the last successfull call
has been returned instead. This commit changes this.

Fixes: OOM
Fixes: 26608/clusterfuzz-testcase-minimized-ffmpeg_dem_APNG_fuzzer-4839491644424192
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavformat/apngdec.c