[FFmpeg-cvslog] avdevice/openal-dec: Check the return code of av_new_packet()

Michael Niedermayer git at videolan.org
Mon Jan 19 00:44:41 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Jan 19 00:34:18 2015 +0100| [bf8bcd3b2b51c4d3f0a157e80a8c96c8542217b0] | committer: Michael Niedermayer

avdevice/openal-dec: Check the return code of av_new_packet()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bf8bcd3b2b51c4d3f0a157e80a8c96c8542217b0
---

 libavdevice/openal-dec.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavdevice/openal-dec.c b/libavdevice/openal-dec.c
index 4c4ba28..37d321a 100644
--- a/libavdevice/openal-dec.c
+++ b/libavdevice/openal-dec.c
@@ -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 */



More information about the ffmpeg-cvslog mailing list