Commit 42b6805c authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/huffyuvdec: clear remainder of the array on end of input in decode_422_bitstream()

Fixes: msan_uninit-mem_7f909423efcd_9923_yuv_predmed.avi
Fixes use of uninitialized memory
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 0875a9e4
......@@ -406,6 +406,9 @@ static void decode_422_bitstream(HYuvContext *s, int count)
READ_2PIX(s->temp[0][2 * i ], s->temp[1][i], 1);
READ_2PIX(s->temp[0][2 * i + 1], s->temp[2][i], 2);
}
for (; i < count; i++)
s->temp[0][2 * i ] = s->temp[1][i] =
s->temp[0][2 * i + 1] = s->temp[2][i] = 128;
} else {
for (i = 0; i < count; i++) {
READ_2PIX(s->temp[0][2 * i ], s->temp[1][i], 1);
......
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