Commit 2c00b373 authored by Michael Niedermayer's avatar Michael Niedermayer

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/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent a2ca9e11
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment