]> git.sesse.net Git - ffmpeg/commitdiff
avdevice/openal-dec: Check the return code of av_new_packet()
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 18 Jan 2015 23:34:18 +0000 (00:34 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 18 Jan 2015 23:34:18 +0000 (00:34 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavdevice/openal-dec.c

index 4c4ba28c22f6e7124f98ac3a4fa6a754ddfa9bd3..37d321a35de02a8673cd568069cffc17cbf3dd94 100644 (file)
@@ -192,7 +192,8 @@ static int read_packet(AVFormatContext* ctx, AVPacket *pkt)
     if (error = al_get_error(ad->device, &error_msg)) goto fail;
 
     /* Create a packet of appropriate size */
-    av_new_packet(pkt, nb_samples*ad->sample_step);
+    if ((error = av_new_packet(pkt, nb_samples*ad->sample_step)) < 0)
+        goto fail;
     pkt->pts = av_gettime();
 
     /* Fill the packet with the available samples */