]> git.sesse.net Git - ffmpeg/commitdiff
avformat/vividas: check for tiny blocks using alignment
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 31 Aug 2019 21:20:01 +0000 (23:20 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 6 Sep 2019 20:25:35 +0000 (22:25 +0200)
Ask for a sample for these
Fixes: out of array access
Fixes: 16624/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5762455661182976
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/vividas.c

index 645e322b6e7be938ec1507cff090ca18c0202c49..1ac86a107e2d86c7a38db9f19731e1cd71b2ce26 100644 (file)
@@ -153,6 +153,10 @@ static void decode_block(uint8_t *src, uint8_t *dest, unsigned size,
 
     if (align) {
         uint32_t tmpkey = *key_ptr - key;
+        if (a2 > s) {
+            a2 = s;
+            avpriv_request_sample(NULL, "tiny aligned block\n");
+        }
         memcpy(tmp + align, src, a2);
         xor_block(tmp, tmp, 4, key, &tmpkey);
         memcpy(dest, tmp + align, a2);