avformat/oggparseopus: Fix Undefined behavior in oggparseopus.c and libavformat/utils.c
authorThomas Guilbert <tguilbert@google.com>
Fri, 27 May 2016 22:50:25 +0000 (15:50 -0700)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 15 Aug 2016 16:54:34 +0000 (18:54 +0200)
Fixes: usan_granule_overflow

constant type fix by commiter
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1a82d2cf8fb6a7e854e7548dfcf73c3d046b34ac)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/oggparseopus.c

index 584fff4..8bb2a41 100644 (file)
@@ -117,7 +117,7 @@ static int opus_packet(AVFormatContext *avf, int idx)
 
     if (!os->psize)
         return AVERROR_INVALIDDATA;
-    if (os->granule > INT64_MAX - UINT32_MAX) {
+    if (os->granule > (1LL << 62)) {
         av_log(avf, AV_LOG_ERROR, "Unsupported huge granule pos %"PRId64 "\n", os->granule);
         return AVERROR_INVALIDDATA;
     }