avformat/xmv: Check return code of ff_alloc_extradata()
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 15 Dec 2014 14:51:04 +0000 (15:51 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 15 Dec 2014 15:01:05 +0000 (16:01 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/xmv.c

index 01817dc..45c2464 100644 (file)
@@ -294,6 +294,7 @@ static int xmv_process_packet_header(AVFormatContext *s)
 {
     XMVDemuxContext *xmv = s->priv_data;
     AVIOContext     *pb  = s->pb;
+    int ret;
 
     uint8_t  data[8];
     uint16_t audio_track;
@@ -383,7 +384,8 @@ static int xmv_process_packet_header(AVFormatContext *s)
                 if (vst->codec->extradata_size < 4) {
                     av_freep(&vst->codec->extradata);
 
-                    ff_alloc_extradata(vst->codec, 4);
+                    if ((ret = ff_alloc_extradata(vst->codec, 4)) < 0)
+                        return ret;
                 }
 
                 memcpy(vst->codec->extradata, xmv->video.extradata, 4);