aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-02-21 16:22:47 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2017-02-21 19:05:04 +0100
commit0c42d0add37c8a41bc75179efe0571305d9165d1 (patch)
treef5b372c3dd0bb426481dab6baf10f621d2bf5cd9
parent4ec07e943144ec0b7b89bff49bd54e6f6d6db4e8 (diff)
downloadffmpeg-0c42d0add37c8a41bc75179efe0571305d9165d1.tar.gz
avcodec/bmp: Fix runtime error: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
There is code checking height and width later, leaving an invalid value invalid is thus fine. Fixes: 635/clusterfuzz-testcase-6225161437052928 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/bmp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/bmp.c b/libavcodec/bmp.c
index fa1d6a53f2..d462385ca8 100644
--- a/libavcodec/bmp.c
+++ b/libavcodec/bmp.c
@@ -133,7 +133,7 @@ static int bmp_decode_frame(AVCodecContext *avctx,
}
avctx->width = width;
- avctx->height = height > 0 ? height : -height;
+ avctx->height = height > 0 ? height : -(unsigned)height;
avctx->pix_fmt = AV_PIX_FMT_NONE;