libnut: NULL priv->nut after nut_demuxer_uninit() as a saftey precaution.
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 7 Dec 2011 22:35:57 +0000 (23:35 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 8 Dec 2011 20:21:34 +0000 (21:21 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/libnut.c

index be0328a..757f9d2 100644 (file)
@@ -213,6 +213,7 @@ static int nut_read_header(AVFormatContext * avf, AVFormatParameters * ap) {
     if ((ret = nut_read_headers(nut, &s, NULL))) {
         av_log(avf, AV_LOG_ERROR, " NUT error: %s\n", nut_error(ret));
         nut_demuxer_uninit(nut);
+        priv->nut = NULL;
         return -1;
     }
 
@@ -231,6 +232,7 @@ static int nut_read_header(AVFormatContext * avf, AVFormatParameters * ap) {
             st->codec->extradata = av_mallocz(st->codec->extradata_size);
             if(!st->codec->extradata){
                 nut_demuxer_uninit(nut);
+                priv->nut = NULL;
                 return AVERROR(ENOMEM);
             }
             memcpy(st->codec->extradata, s[i].codec_specific, st->codec->extradata_size);