diff --git a/libavcodec/psd.c b/libavcodec/psd.c index 9dc56f8f5e..f4973ecb7e 100644 --- a/libavcodec/psd.c +++ b/libavcodec/psd.c @@ -444,6 +444,8 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture, } s->uncompressed_size = s->line_size * s->height * s->channel_count; + if (s->uncompressed_size > INT_MAX) + return AVERROR_INVALIDDATA; /* decode picture if need */ if (s->compression == PSD_RLE) {