avcodec/psd: reject an uncompressed image size above INT_MAX

Fixes: out of array write
Fixes: MymIHidCHVJu
Fixes: AISLE-2026-0150-00348
Out of array write Replicated through UnModified FFmpeg (32-bit) with ASAN

Found-by: Joshua Rogers (AISLE)
This commit is contained in:
Michael Niedermayer authored and michaelni committed 2026-11-05 23:01:14 +00:00
1 parent 62c308e041
commit aa4b80b54e
1 file changed
+2
+2
View File
@@ -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) {