X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fapngdec.c;h=53cdd4538e010b9c2ef6560adcb6bbc15e60b889;hb=fa08345e882c7b717744419914c6621ef66d0f5b;hp=ffff03710a0e441b6ac8fc4c9c87ef5051360bf3;hpb=061337a073236cb0bc6c56036f50f883d2887681;p=ffmpeg diff --git a/libavformat/apngdec.c b/libavformat/apngdec.c index ffff03710a0..53cdd4538e0 100644 --- a/libavformat/apngdec.c +++ b/libavformat/apngdec.c @@ -44,7 +44,6 @@ typedef struct APNGDemuxContext { int max_fps; int default_fps; - int64_t pkt_pts; int pkt_duration; int is_key_frame; @@ -343,6 +342,10 @@ static int apng_read_packet(AVFormatContext *s, AVPacket *pkt) len = avio_rb32(pb); tag = avio_rl32(pb); + + if (avio_feof(pb)) + return AVERROR_EOF; + switch (tag) { case MKTAG('f', 'c', 'T', 'L'): if (len != 26) @@ -390,9 +393,8 @@ static int apng_read_packet(AVFormatContext *s, AVPacket *pkt) if (ctx->is_key_frame) pkt->flags |= AV_PKT_FLAG_KEY; - pkt->pts = ctx->pkt_pts; + pkt->pts = pkt->dts = AV_NOPTS_VALUE; pkt->duration = ctx->pkt_duration; - ctx->pkt_pts += ctx->pkt_duration; return ret; case MKTAG('I', 'E', 'N', 'D'): ctx->cur_loop++;