avformat/apng: fix setting frame delay when max_fps is set to no limit
authorJames Almer <jamrial@gmail.com>
Tue, 21 Mar 2017 01:53:00 +0000 (22:53 -0300)
committerJames Almer <jamrial@gmail.com>
Tue, 21 Mar 2017 22:15:12 +0000 (19:15 -0300)
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
libavformat/apngdec.c

index bb17896..7a284e3 100644 (file)
@@ -269,7 +269,7 @@ static int decode_fctl_chunk(AVFormatContext *s, APNGDemuxContext *ctx, AVPacket
     /* default is hundredths of seconds */
     if (!delay_den)
         delay_den = 100;
-    if (!delay_num || delay_den / delay_num > ctx->max_fps) {
+    if (!delay_num || (ctx->max_fps && delay_den / delay_num > ctx->max_fps)) {
         delay_num = 1;
         delay_den = ctx->default_fps;
     }