avformat/matroskadec: only set r_frame_rate if the value is within reasonable limits
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 5 Oct 2013 22:07:28 +0000 (00:07 +0200)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Thu, 24 Oct 2013 09:27:50 +0000 (11:27 +0200)
Fixes Ticket2451

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6853e40106cac769f0641183ea0bdd530ae9a0a1)

libavformat/matroskadec.c

index fbc1d40..9a0121a 100644 (file)
@@ -1756,7 +1756,8 @@ static int matroska_read_header(AVFormatContext *s)
                 av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den,
                           1000000000, track->default_duration, 30000);
 #if FF_API_R_FRAME_RATE
-                st->r_frame_rate = st->avg_frame_rate;
+                if (st->avg_frame_rate.num < st->avg_frame_rate.den * 1000L)
+                    st->r_frame_rate = st->avg_frame_rate;
 #endif
             }