bit: check av_new_packet() return value
authorPaul B Mahol <onemda@gmail.com>
Fri, 26 Oct 2012 15:31:00 +0000 (15:31 +0000)
committerPaul B Mahol <onemda@gmail.com>
Fri, 26 Oct 2012 15:34:25 +0000 (15:34 +0000)
Fixes CID703626.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavformat/bit.c

index 03c6152..9f6ea4a 100644 (file)
@@ -90,7 +90,8 @@ static int read_packet(AVFormatContext *s,
     if(ret != 8 * packet_size * sizeof(uint16_t))
         return AVERROR(EIO);
 
-    av_new_packet(pkt, packet_size);
+    if (av_new_packet(pkt, packet_size) < 0)
+        return AVERROR(ENOMEM);
 
     init_put_bits(&pbo, pkt->data, packet_size);
     for(j=0; j < packet_size; j++)