aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-10-16 02:38:02 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-16 02:38:02 +0200
commit658c5209fb548746269470a7f2c52b9ad443e72e (patch)
tree313d1f059eb55e0342216b09a982635ff623fc9f
parent3e01c9b5472cdeff002d9ebc4fb7a46a54210bfa (diff)
downloadffmpeg-658c5209fb548746269470a7f2c52b9ad443e72e.tar.gz
idf: Improve idf_probe() so it doesnt succeed on 0 byte input
-rw-r--r--libavformat/bintext.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/bintext.c b/libavformat/bintext.c
index 69c7ab5039..e03a31e447 100644
--- a/libavformat/bintext.c
+++ b/libavformat/bintext.c
@@ -261,7 +261,9 @@ static const uint8_t idf_magic[] = {
static int idf_probe(AVProbeData *p)
{
- if (!memcmp(p->buf, idf_magic, FFMIN(sizeof(idf_magic), p->buf_size)))
+ if (p->buf_size < sizeof(idf_magic))
+ return 0;
+ if (!memcmp(p->buf, idf_magic, sizeof(idf_magic)))
return AVPROBE_SCORE_MAX;
return 0;
}