avformat/oggparsespeex: Check for extradata allocation failure
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 20 Oct 2013 14:57:45 +0000 (16:57 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 20 Oct 2013 14:57:45 +0000 (16:57 +0200)
Fixes CID1108574
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/oggparsespeex.c

index 7cbc7e0..1b9de9c 100644 (file)
@@ -77,7 +77,8 @@ static int speex_header(AVFormatContext *s, int idx) {
         if (frames_per_packet)
             spxp->packet_size *= frames_per_packet;
 
-        ff_alloc_extradata(st->codec, os->psize);
+        if (ff_alloc_extradata(st->codec, os->psize) < 0)
+            return AVERROR(ENOMEM);
         memcpy(st->codec->extradata, p, st->codec->extradata_size);
 
         avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);