]> git.sesse.net Git - vlc/commitdiff
Fixed potential division by 0 in vout_AllocatePicture.
authorLaurent Aimar <fenrir@videolan.org>
Sun, 21 Feb 2010 21:47:58 +0000 (22:47 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Sun, 21 Feb 2010 21:47:58 +0000 (22:47 +0100)
src/video_output/vout_pictures.c

index 2ac077ce1dc5fe72f28f194085530ef177ff2340..98b8e41412203bd3494e9979ee91f34b7c958bb4 100644 (file)
@@ -524,7 +524,7 @@ int vout_AllocatePicture( vlc_object_t *p_this, picture_t *p_pic,
     size_t i_bytes = 0;
     /* i_width_aligned is a multiple of 16, so we can divide by 8 now */
     size_t i_width_aligned_divided = i_width_aligned / 8;
-    if( i_width_aligned_divided <= (SIZE_MAX/i_height_aligned) )
+    if( i_height_aligned > 0 && i_width_aligned_divided <= (SIZE_MAX/i_height_aligned) )
     {
         size_t i_pixels_divided = i_width_aligned_divided * i_height_aligned;
         size_t i_bpp = p_pic->format.i_bits_per_pixel;