Browse Source

avcodec/pixlet: fixes integer overflow in read_highpass()

Fixes: runtime error: negation of -2147483648 cannot be represented in type 'int32_t' (aka 'int'); cast to an unsigned type to negate this value to itself
Fixes: 2879/clusterfuzz-testcase-minimized-6317542639403008

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 cadab5a2a7)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.3.4
Michael Niedermayer 7 years ago
parent
commit
53dae9585f
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      libavcodec/pixlet.c

+ 3
- 0
libavcodec/pixlet.c View File

@@ -331,6 +331,9 @@ static int read_highpass(AVCodecContext *avctx, uint8_t *ptr, int plane, AVFrame
return AVERROR_INVALIDDATA;
}

if (a == INT32_MIN)
return AVERROR_INVALIDDATA;

ret = read_high_coeffs(avctx, ptr + bytestream2_tell(&ctx->gb), dest, size,
c, (b >= FFABS(a)) ? b : a, d,
ctx->band[plane][i + 1].width, stride);


Loading…
Cancel
Save