[FFmpeg-cvslog] mxfdec: check index_tables before dereferencing in close.
Michael Niedermayer
git at videolan.org
Sat Dec 1 20:21:28 CET 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Dec 1 20:15:02 2012 +0100| [873049e6d854a69292934eb882731dd2ad7438b9] | committer: Michael Niedermayer
mxfdec: check index_tables before dereferencing in close.
Fixes null pointer dereference
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=873049e6d854a69292934eb882731dd2ad7438b9
---
libavformat/mxfdec.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 06bca10..921dc42 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -2250,10 +2250,12 @@ static int mxf_read_close(AVFormatContext *s)
av_freep(&mxf->aesc);
av_freep(&mxf->local_tags);
- for (i = 0; i < mxf->nb_index_tables; i++) {
- av_freep(&mxf->index_tables[i].segments);
- av_freep(&mxf->index_tables[i].ptses);
- av_freep(&mxf->index_tables[i].fake_index);
+ if (mxf->index_tables) {
+ for (i = 0; i < mxf->nb_index_tables; i++) {
+ av_freep(&mxf->index_tables[i].segments);
+ av_freep(&mxf->index_tables[i].ptses);
+ av_freep(&mxf->index_tables[i].fake_index);
+ }
}
av_freep(&mxf->index_tables);
More information about the ffmpeg-cvslog
mailing list