diff --git a/libavcodec/exr.c b/libavcodec/exr.c index 40c24f8adb..8665cac1c0 100644 --- a/libavcodec/exr.c +++ b/libavcodec/exr.c @@ -1703,7 +1703,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) return ret; - if (bytestream2_get_bytes_left(&s->gb) < nb_blocks * 8) + if (bytestream2_get_bytes_left(&s->gb)/8 < nb_blocks) return AVERROR_INVALIDDATA; // save pointer we are going to use in decode_block