[FFmpeg-cvslog] avformat/thp: check fps value during probing

Michael Niedermayer git at videolan.org
Sun Nov 10 02:22:35 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Nov 10 01:42:22 2013 +0100| [52268def10f33e36ca1190906c8235f4e91fcf24] | committer: Michael Niedermayer

avformat/thp: check fps value during probing

Fixes probetest failure

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=52268def10f33e36ca1190906c8235f4e91fcf24
---

 libavformat/thp.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/libavformat/thp.c b/libavformat/thp.c
index 870a558..bc4f0daf 100644
--- a/libavformat/thp.c
+++ b/libavformat/thp.c
@@ -47,11 +47,16 @@ typedef struct ThpDemuxContext {
 
 static int thp_probe(AVProbeData *p)
 {
+    double d;
     /* check file header */
-    if (AV_RL32(p->buf) == MKTAG('T', 'H', 'P', '\0'))
-        return AVPROBE_SCORE_MAX;
-    else
+    if (AV_RL32(p->buf) != MKTAG('T', 'H', 'P', '\0'))
         return 0;
+
+    d = av_int2float(AV_RB32(p->buf + 16));
+    if (d < 0.1 || d > 1000 || isnan(d))
+        return AVPROBE_SCORE_MAX/4;
+
+    return AVPROBE_SCORE_MAX;
 }
 
 static int thp_read_header(AVFormatContext *s)



More information about the ffmpeg-cvslog mailing list