Skip to content

Commit ff5cce2

Browse files
committed
avcodec/motionpixels: Mask pixels to valid values
Fixes: out of array access Fixes: 48567/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MOTIONPIXELS_fuzzer-6724203352555520 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <[email protected]> (cherry picked from commit ac6eec1) Signed-off-by: Michael Niedermayer <[email protected]>
1 parent 1eb1acb commit ff5cce2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libavcodec/motionpixels.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ static YuvPixel mp_get_yuv_from_rgb(MotionPixelsContext *mp, int x, int y)
185185
int color;
186186

187187
color = *(uint16_t *)&mp->frame->data[0][y * mp->frame->linesize[0] + x * 2];
188-
return mp_rgb_yuv_table[color];
188+
return mp_rgb_yuv_table[color & 0x7FFF];
189189
}
190190

191191
static void mp_set_rgb_from_yuv(MotionPixelsContext *mp, int x, int y, const YuvPixel *p)

0 commit comments

Comments
 (0)