changeset 3403:65f48adb4cc9 libavformat

Check av_new_stream return value, fixes CID75 RUN2
author reimar
date Thu, 29 May 2008 15:59:14 +0000
parents c30e9e11baf9
children 99033f7987cb
files daud.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/daud.c	Thu May 29 15:40:16 2008 +0000
+++ b/daud.c	Thu May 29 15:59:14 2008 +0000
@@ -22,6 +22,8 @@
 
 static int daud_header(AVFormatContext *s, AVFormatParameters *ap) {
     AVStream *st = av_new_stream(s, 0);
+    if (!st)
+        return AVERROR(ENOMEM);
     st->codec->codec_type = CODEC_TYPE_AUDIO;
     st->codec->codec_id = CODEC_ID_PCM_S24DAUD;
     st->codec->codec_tag = MKTAG('d', 'a', 'u', 'd');