avformat/apngdec: fix playback of piped apng files

The check for avio_size() made apng_read_header() return an error
instead of just disabling looping.
This commit is contained in:
Ramiro Polla
2026-04-21 15:23:17 +02:00
parent 2e92764b86
commit 0cd2bbe4f4
+2 -5
View File
@@ -194,11 +194,8 @@ static int apng_read_header(AVFormatContext *s)
if (acTL_found && ctx->num_play != 1) {
int64_t size = avio_size(pb);
int64_t offset = avio_tell(pb);
if (size < 0) {
return size;
} else if (offset < 0) {
return offset;
} else if ((ret = ffio_ensure_seekback(pb, size - offset)) < 0) {
if (size < 0 || offset < 0 ||
(ret = ffio_ensure_seekback(pb, size - offset)) < 0) {
av_log(s, AV_LOG_WARNING, "Could not ensure seekback, will not loop\n");
ctx->num_play = 1;
}