Merge commit '710b0e27025948b7511821c2f888ff2d74a59e14'
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 12 Sep 2013 09:38:55 +0000 (11:38 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 12 Sep 2013 09:39:18 +0000 (11:39 +0200)
* commit '710b0e27025948b7511821c2f888ff2d74a59e14':
  smacker: Avoid integer overflow when allocating packets

Merged-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/smacker.c

index b219153..65440c9 100644 (file)
@@ -331,7 +331,7 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt)
             }
             flags >>= 1;
         }
-        if (frame_size < 0)
+        if (frame_size < 0 || frame_size >= INT_MAX/2)
             return AVERROR_INVALIDDATA;
         if (av_new_packet(pkt, frame_size + 769))
             return AVERROR(ENOMEM);