diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2023-01-12 23:42:59 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2023-04-21 01:55:16 +0200 |
commit | 8215c6b21c216e6a6a4d8bc69052c39d7d2aa8ec (patch) | |
tree | a1095769625c1209e1f802c58479be06942a109c | |
parent | fbe41b907aa35bf45b01c31ed63ad639b3e54a9a (diff) | |
download | ffmpeg-8215c6b21c216e6a6a4d8bc69052c39d7d2aa8ec.tar.gz |
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 <michael@niedermayer.cc>
(cherry picked from commit ac6eec1fc258efce219e4fccb84312a1b13a7a23)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/motionpixels.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c index 8750a4fa16..85b0056e48 100644 --- a/libavcodec/motionpixels.c +++ b/libavcodec/motionpixels.c @@ -185,7 +185,7 @@ static YuvPixel mp_get_yuv_from_rgb(MotionPixelsContext *mp, int x, int y) int color; color = *(uint16_t *)&mp->frame->data[0][y * mp->frame->linesize[0] + x * 2]; - return mp_rgb_yuv_table[color]; + return mp_rgb_yuv_table[color & 0x7FFF]; } static void mp_set_rgb_from_yuv(MotionPixelsContext *mp, int x, int y, const YuvPixel *p) |