au: validate sample rate
authorJustin Ruggles <justin.ruggles@gmail.com>
Sun, 23 Dec 2012 18:39:31 +0000 (13:39 -0500)
committerJustin Ruggles <justin.ruggles@gmail.com>
Wed, 9 Jan 2013 16:52:57 +0000 (11:52 -0500)
libavformat/au.c

index f055a6fdf21c5a157cc811176227a57e0d7808a8..27feef7e399fbc7a405322ff377545a11dcc3df5 100644 (file)
@@ -104,6 +104,11 @@ static int au_read_header(AVFormatContext *s)
         return AVERROR_INVALIDDATA;
     }
 
+    if (rate == 0 || rate > INT_MAX) {
+        av_log(s, AV_LOG_ERROR, "Invalid sample rate: %u\n", rate);
+        return AVERROR_INVALIDDATA;
+    }
+
     /* now we are ready: build format streams */
     st = avformat_new_stream(s, NULL);
     if (!st)