Commit 33f12f75 authored by Rafaël Carré's avatar Rafaël Carré

Fix integer overflow in picture size calculation

Closes #2885
parent c2df9da6
......@@ -556,7 +556,7 @@ int __vout_AllocatePicture( vlc_object_t *p_this, picture_t *p_pic,
int i_width, int i_height, int i_aspect )
{
VLC_UNUSED(p_this);
int i_bytes, i_index, i_width_aligned, i_height_aligned;
int i_index, i_width_aligned, i_height_aligned;
/* Make sure the real dimensions are a multiple of 16 */
i_width_aligned = (i_width + 15) >> 4 << 4;
......@@ -570,7 +570,7 @@ int __vout_AllocatePicture( vlc_object_t *p_this, picture_t *p_pic,
}
/* Calculate how big the new image should be */
i_bytes = p_pic->format.i_bits_per_pixel *
size_t i_bytes = (size_t)p_pic->format.i_bits_per_pixel *
i_width_aligned * i_height_aligned / 8;
p_pic->p_data = vlc_memalign( &p_pic->p_data_orig, 16, i_bytes );
......
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