diff options
author | Paul B Mahol <onemda@gmail.com> | 2017-02-23 17:22:01 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2017-02-23 17:22:01 +0100 |
commit | fd7af82c53ea8a2577ea8952d35fb158db594592 (patch) | |
tree | 89b0dd4cfd9b5472174d1603d0a51aa21b33e035 /libavcodec/scpr.c | |
parent | f062947261447112c8026e2f329a685daa415936 (diff) | |
download | ffmpeg-fd7af82c53ea8a2577ea8952d35fb158db594592.tar.gz |
avcodec/scpr: do not allow out of array access for 16bit case
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/scpr.c')
-rw-r--r-- | libavcodec/scpr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/scpr.c b/libavcodec/scpr.c index f53f1d4039..73e7eedb77 100644 --- a/libavcodec/scpr.c +++ b/libavcodec/scpr.c @@ -408,7 +408,7 @@ static int decompress_i(AVCodecContext *avctx, uint32_t *dst, int linesize) } if (avctx->bits_per_coded_sample == 16) { - cx1 = (clr & 0xFF00) >> 2; + cx1 = (clr & 0x3F00) >> 2; cx = (clr & 0xFFFFFF) >> 16; } else { cx1 = (clr & 0xFC00) >> 4; @@ -647,7 +647,7 @@ static int decompress_p(AVCodecContext *avctx, } if (avctx->bits_per_coded_sample == 16) { - cx1 = (clr & 0xFF00) >> 2; + cx1 = (clr & 0x3F00) >> 2; cx = (clr & 0xFFFFFF) >> 16; } else { cx1 = (clr & 0xFC00) >> 4; |