Commit c8aaae8e authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/dpx: Move need_align to act per line

Fixes out of array read
Fixes: 61cf123c081ee2bb774d307c75bdb99e/asan_heap-oob_1224f76_5546_bee833ffae73f752b489b9eeaac52db7.dpx

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 4c8d86eb
...@@ -348,11 +348,11 @@ static int decode_frame(AVCodecContext *avctx, ...@@ -348,11 +348,11 @@ static int decode_frame(AVCodecContext *avctx,
// For 12 bit, ignore alpha // For 12 bit, ignore alpha
if (elements == 4) if (elements == 4)
buf += 2; buf += 2;
// Jump to next aligned position
buf += need_align;
} }
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
ptr[i] += p->linesize[i]; ptr[i] += p->linesize[i];
// Jump to next aligned position
buf += need_align;
} }
break; break;
case 16: case 16:
......
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