mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-13 18:40:03 +01:00
avcodec/huffyuvdec: Initialize whole output for decode_gray_bitstream()
Fixes: use of uninitialized memory
Fixes: 375286238/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HYMT_fuzzer-6352546854141952
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ef71552cf9)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -773,6 +773,8 @@ static void decode_gray_bitstream(HYuvDecContext *s, int count)
|
|||||||
for (i = 0; i < count && BITS_LEFT(re, &s->gb) > 0; i++) {
|
for (i = 0; i < count && BITS_LEFT(re, &s->gb) > 0; i++) {
|
||||||
READ_2PIX(s->temp[0][2 * i], s->temp[0][2 * i + 1], 0);
|
READ_2PIX(s->temp[0][2 * i], s->temp[0][2 * i + 1], 0);
|
||||||
}
|
}
|
||||||
|
for (; i < count; i++)
|
||||||
|
s->temp[0][2 * i] = s->temp[0][2 * i + 1] = 0;
|
||||||
} else {
|
} else {
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
READ_2PIX(s->temp[0][2 * i], s->temp[0][2 * i + 1], 0);
|
READ_2PIX(s->temp[0][2 * i], s->temp[0][2 * i + 1], 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user