avcodec/avpacket: Check metadata key in av_packet_unpack_dictionary()

Fixes timeout
Fixes: 501/clusterfuzz-testcase-5672752870588416

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2017-02-27 04:12:09 +01:00
parent a2ca9e11ff
commit 2c00b37302
1 changed files with 1 additions and 1 deletions

View File

@ -508,7 +508,7 @@ int av_packet_unpack_dictionary(const uint8_t *data, int size, AVDictionary **di
const uint8_t *key = data;
const uint8_t *val = data + strlen(key) + 1;
if (val >= end)
if (val >= end || !*key)
return AVERROR_INVALIDDATA;
ret = av_dict_set(dict, key, val, 0);