avformat/mpc: attempt to allocate a packet that is not smaller than the data inside it
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 14 Jun 2014 22:49:02 +0000 (00:49 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 23 Jun 2014 16:17:43 +0000 (18:17 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 86a9370e2b91d67375e66a06d6eb573b5a017775)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/mpc.c

index b0f6f53..a46919b 100644 (file)
@@ -153,7 +153,7 @@ static int mpc_read_packet(AVFormatContext *s, AVPacket *pkt)
     }
     c->curbits = (curbits + size2) & 0x1F;
 
-    if ((ret = av_new_packet(pkt, size)) < 0)
+    if ((ret = av_new_packet(pkt, size + 4)) < 0)
         return ret;
 
     pkt->data[0] = curbits;