summaryrefslogtreecommitdiff
path: root/libavcodec/avpacket.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-02-27 04:12:09 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2017-03-01 14:07:33 +0100
commit2c00b373024054e0779ef67fc54b763d624db3e8 (patch)
treef0b7a2759e4f1087de50fbdc90a29aa67e721923 /libavcodec/avpacket.c
parenta2ca9e11ff7166cbbc0314d152702a201f6a14fb (diff)
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>
Diffstat (limited to 'libavcodec/avpacket.c')
-rw-r--r--libavcodec/avpacket.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 8e028a2a6c..60269aa63d 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -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);