summaryrefslogtreecommitdiff
path: root/libavformat/mxfdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-12-01 20:15:02 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-12-01 20:19:09 +0100
commit873049e6d854a69292934eb882731dd2ad7438b9 (patch)
tree643b9c7dc34c18e5200d926e8f1fd238e0bffba8 /libavformat/mxfdec.c
parent7389bb12e6b3ec3660592fde370d9dd4fe816d2b (diff)
downloadffmpeg-873049e6d854a69292934eb882731dd2ad7438b9.tar.gz
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@gmx.at>
Diffstat (limited to 'libavformat/mxfdec.c')
-rw-r--r--libavformat/mxfdec.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 06bca10c03..921dc427a3 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);