]> git.sesse.net Git - ffmpeg/commitdiff
mov: zero sc->pb in mov_read_close()
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 13 Apr 2012 10:09:32 +0000 (12:09 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 13 Apr 2012 10:09:32 +0000 (12:09 +0200)
Its bad to free things without zeroing them.
This fixes a potential issue when mov_read_close() would be called twice.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/mov.c

index 5b81ba87230cad22507a909bf13a791d96546aa3..234c1f5ce1f87d1f67859c35b7e6dd868feaa0c2 100644 (file)
@@ -2782,6 +2782,7 @@ static int mov_read_close(AVFormatContext *s)
         av_freep(&sc->drefs);
         if (sc->pb && sc->pb != s->pb)
             avio_close(sc->pb);
+        sc->pb = NULL;
         av_freep(&sc->chunk_offsets);
         av_freep(&sc->keyframes);
         av_freep(&sc->sample_sizes);