]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/v210dec: Fix alignment check for AVX2
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 18 May 2019 07:32:58 +0000 (09:32 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 19 May 2019 08:47:09 +0000 (10:47 +0200)
Fixes: "null pointer dereference" (actually misaligned access but the tools seem not to support this)
Fixes: 14551/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_V210_fuzzer-5088609952071680
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/v210dec.c

index bc1e1d34ff0213125fbefbbe9b1d3852e4bbf6ff..5a33d8c08997636fa65f8ef057a2a0cc2e339dfd 100644 (file)
@@ -104,7 +104,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
         && avpkt->size - 64 >= stride * avctx->height)
         psrc += 64;
 
-    aligned_input = !((uintptr_t)psrc & 0xf) && !(stride & 0xf);
+    aligned_input = !((uintptr_t)psrc & 0x1f) && !(stride & 0x1f);
     if (aligned_input != s->aligned_input) {
         s->aligned_input = aligned_input;
         ff_v210dec_init(s);