summaryrefslogtreecommitdiff
path: root/libavformat/thp.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-11-10 01:42:22 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-11-10 02:04:08 +0100
commit52268def10f33e36ca1190906c8235f4e91fcf24 (patch)
treeabb7072e2b7f02b1674fde9732afcbba04f314e0 /libavformat/thp.c
parent858ef562973756f7f445447806c61c4c63bbebd7 (diff)
avformat/thp: check fps value during probing
Fixes probetest failure Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/thp.c')
-rw-r--r--libavformat/thp.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libavformat/thp.c b/libavformat/thp.c
index 870a558a36..bc4f0dafe5 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)