Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/video_output/vout_pictures.c b/src/video_output/vout_pictures.c
- index 68656bc..ce35df4 100644
- --- a/src/video_output/vout_pictures.c
- +++ b/src/video_output/vout_pictures.c
- @@ -570,8 +570,13 @@ int __vout_AllocatePicture( vlc_object_t *p_this, picture_t
- }
- /* Calculate how big the new image should be */
- - size_t i_bytes = (size_t)p_pic->format.i_bits_per_pixel *
- - i_width_aligned * i_height_aligned / 8;
- + uint64_t i_pixels = i_width_aligned * i_height_aligned;
- + uint64_t i_bytes = i_pixels * p_pic->format.i_bits_per_pixel / 8;
- + if( i_bytes > SIZE_MAX || i_bytes < i_pixels ) /* prevent overflow */
- + {
- + p_pic->i_planes = 0;
- + return VLC_ENOMEM;
- + }
- p_pic->p_data = vlc_memalign( &p_pic->p_data_orig, 16, i_bytes );
Add Comment
Please, Sign In to add comment