summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2012-11-18 08:52:50 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2012-11-18 08:52:50 +0100
commitab82b77822a781ce8e6705aa6db8c8c1b4630d58 (patch)
treecdddc41fb1a87e3d0ed48d48f1f370e7da98c58c /libavformat
parentdab19048a1fb8e722cd2029b63ce1fc9d84ff41e (diff)
Fix possible NULL-pointer dereference when decoding mov files.
Fixes CID743440, introduced in 850e5c0.
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mov.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 9b179cbc85..cff9c923bf 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1384,6 +1384,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
} else if (st->codec->codec_type==AVMEDIA_TYPE_AUDIO) {
int bits_per_sample, flags;
uint16_t version = avio_rb16(pb);
+ AVDictionaryEntry *compatible_brands = av_dict_get(c->fc->metadata, "compatible_brands", NULL, AV_DICT_MATCH_CASE);
st->codec->codec_id = id;
avio_rb16(pb); /* revision level */
@@ -1401,7 +1402,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
//Read QT version 1 fields. In version 0 these do not exist.
av_dlog(c->fc, "version =%d, isom =%d\n",version,c->isom);
if (!c->isom ||
- strstr(av_dict_get(c->fc->metadata, "compatible_brands", NULL, AV_DICT_MATCH_CASE)->value, "qt ")) {
+ (compatible_brands && strstr(compatible_brands->value, "qt "))) {
if (version==1) {
sc->samples_per_frame = avio_rb32(pb);
avio_rb32(pb); /* bytes per packet */