[FFmpeg-cvslog] idf: Improve idf_probe() so it doesnt succeed on 0 byte input

Michael Niedermayer git at videolan.org
Sun Oct 16 03:10:00 CEST 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Oct 16 02:38:02 2011 +0200| [658c5209fb548746269470a7f2c52b9ad443e72e] | committer: Michael Niedermayer

idf: Improve idf_probe() so it doesnt succeed on 0 byte input

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

 libavformat/bintext.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/libavformat/bintext.c b/libavformat/bintext.c
index 69c7ab5..e03a31e 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;
 }



More information about the ffmpeg-cvslog mailing list