diff options
author | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2016-11-05 00:17:53 +0100 |
---|---|---|
committer | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2016-11-05 18:56:41 +0100 |
commit | 0efb6106118c17308b3fdc3190f5e5bf84b01d5c (patch) | |
tree | 7f62559d37680720cfd773c006a99f016d6eb4f0 | |
parent | bb6a7b6f75ac544c956e3eefee297700ef4d3468 (diff) | |
download | ffmpeg-0efb6106118c17308b3fdc3190f5e5bf84b01d5c.tar.gz |
mxfdec: fix NULL pointer dereference
Metadata streams have priv_data set to NULL.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
-rw-r--r-- | libavformat/mxfdec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index d2166ee5a1..a1a79ceb51 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -391,7 +391,7 @@ static int mxf_get_stream_index(AVFormatContext *s, KLVPacket *klv) for (i = 0; i < s->nb_streams; i++) { MXFTrack *track = s->streams[i]->priv_data; /* SMPTE 379M 7.3 */ - if (!memcmp(klv->key + sizeof(mxf_essence_element_key), track->track_number, sizeof(track->track_number))) + if (track && !memcmp(klv->key + sizeof(mxf_essence_element_key), track->track_number, sizeof(track->track_number))) return i; } /* return 0 if only one stream, for OP Atom files with 0 as track number */ |