[FFmpeg-devel] [PATCH 3/3] libnut: NULL priv->nut after nut_demuxer_uninit() as a saftey precaution.

Michael Niedermayer michaelni at gmx.at
Wed Dec 7 23:38:18 CET 2011


Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavformat/libnut.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavformat/libnut.c b/libavformat/libnut.c
index be0328a..757f9d2 100644
--- a/libavformat/libnut.c
+++ b/libavformat/libnut.c
@@ -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);
-- 
1.7.5.4



More information about the ffmpeg-devel mailing list