aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-10-20 23:02:27 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-12-31 19:51:56 +0100
commitb56388541bc46488c85f8d648e202686bddba1f9 (patch)
tree45804f8a232a0d4f4256991a63ca6341ce5b9ae4
parentf0bd54aaa78c9b965c9d135757adfc033bbf54be (diff)
downloadffmpeg-b56388541bc46488c85f8d648e202686bddba1f9.tar.gz
avcodec/rawdec: Check bits_per_coded_sample more pedantically for 16bit cases
Fixes: shift exponent -14 is negative Fixes: 18335/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RAWVIDEO_fuzzer-5723267192586240 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 5634e2052533fcce46f20c2720b0c8d5f55143ce) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/rawdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c
index 53f5b76e93..0b2d8708e6 100644
--- a/libavcodec/rawdec.c
+++ b/libavcodec/rawdec.c
@@ -223,7 +223,7 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame,
FFALIGN(avctx->width, 16),
avctx->height, 1);
} else {
- context->is_lt_16bpp = av_get_bits_per_pixel(desc) == 16 && avctx->bits_per_coded_sample && avctx->bits_per_coded_sample < 16;
+ context->is_lt_16bpp = av_get_bits_per_pixel(desc) == 16 && avctx->bits_per_coded_sample > 8 && avctx->bits_per_coded_sample < 16;
context->frame_size = av_image_get_buffer_size(avctx->pix_fmt, avctx->width,
avctx->height, 1);
}