[FFmpeg-cvslog] avcodec/avpacket: Check metadata key in av_packet_unpack_dictionary()

Michael Niedermayer git at videolan.org
Wed Mar 1 15:08:15 EET 2017


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Mon Feb 27 04:12:09 2017 +0100| [2c00b373024054e0779ef67fc54b763d624db3e8] | committer: 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/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2c00b373024054e0779ef67fc54b763d624db3e8
---

 libavcodec/avpacket.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 8e028a2..60269aa 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);



More information about the ffmpeg-cvslog mailing list