Commit bd467e94 authored by Luca Barbato's avatar Luca Barbato Committed by Jean-Baptiste Kempf

avcodec: Extend the check for impossible dimensions

Overly large frame sizes are commonly caused by broken streams.

Close #11245
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 9d06856d
...@@ -136,9 +136,12 @@ static inline picture_t *ffmpeg_NewPictBuf( decoder_t *p_dec, ...@@ -136,9 +136,12 @@ static inline picture_t *ffmpeg_NewPictBuf( decoder_t *p_dec,
avcodec_align_dimensions2(p_context, &width, &height, aligns); avcodec_align_dimensions2(p_context, &width, &height, aligns);
} }
if( width == 0 || height == 0)
return NULL; /* invalid display size */
if( width == 0 || height == 0 || width > 8192 || height > 8192 )
{
msg_Err( p_dec, "Invalid frame size %dx%d.", width, height );
return NULL; /* invalid display size */
}
p_dec->fmt_out.video.i_width = width; p_dec->fmt_out.video.i_width = width;
p_dec->fmt_out.video.i_height = height; p_dec->fmt_out.video.i_height = height;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment