Browse Source

avcodec/scpr: mask bits to prevent out of array read

Fixes: 1615/clusterfuzz-testcase-minimized-6625214647500800

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.4
Michael Niedermayer 8 years ago
parent
commit
5666b95c9f
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavcodec/scpr.c

+ 2
- 2
libavcodec/scpr.c View File

@@ -488,7 +488,7 @@ static int decompress_i(AVCodecContext *avctx, uint32_t *dst, int linesize)

if (avctx->bits_per_coded_sample == 16) {
cx1 = (clr & 0x3F00) >> 2;
cx = (clr & 0xFFFFFF) >> 16;
cx = (clr & 0x3FFFFF) >> 16;
} else {
cx1 = (clr & 0xFC00) >> 4;
cx = (clr & 0xFFFFFF) >> 18;
@@ -726,7 +726,7 @@ static int decompress_p(AVCodecContext *avctx,

if (avctx->bits_per_coded_sample == 16) {
cx1 = (clr & 0x3F00) >> 2;
cx = (clr & 0xFFFFFF) >> 16;
cx = (clr & 0x3FFFFF) >> 16;
} else {
cx1 = (clr & 0xFC00) >> 4;
cx = (clr & 0xFFFFFF) >> 18;


Loading…
Cancel
Save