You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/pgssubdec: Check dimensions for 0
Fixes division by 0 Fixes: b293a6479bb4b5286cff24d356bfd955/asan_generic_225c3c9_7819_cc526b657450c6cdef1371b526499626.mkv Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -290,8 +290,8 @@ static int parse_object_segment(AVCodecContext *avctx,
|
|||||||
height = bytestream_get_be16(&buf);
|
height = bytestream_get_be16(&buf);
|
||||||
|
|
||||||
/* Make sure the bitmap is not too large */
|
/* Make sure the bitmap is not too large */
|
||||||
if (avctx->width < width || avctx->height < height) {
|
if (avctx->width < width || avctx->height < height || !width || !height) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Bitmap dimensions larger than video.\n");
|
av_log(avctx, AV_LOG_ERROR, "Bitmap dimensions (%dx%d) invalid.\n", width, height);
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user