diff --git a/libavformat/jpegxl_anim_dec.c b/libavformat/jpegxl_anim_dec.c index fc95a1781f..54cd6e4e9d 100644 --- a/libavformat/jpegxl_anim_dec.c +++ b/libavformat/jpegxl_anim_dec.c @@ -152,6 +152,8 @@ static int jpegxl_anim_read_packet(AVFormatContext *s, AVPacket *pkt) size = avio_size(pb); if (size < 0) return size; + if (size > INT_MAX) + return AVERROR(EDOM); if (size == 0) size = 4096;