[vlc-devel] commit: Fixed potential division by 0 in vout_AllocatePicture. ( Laurent Aimar )

git version control git at videolan.org
Sun Feb 21 23:34:07 CET 2010


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Feb 21 22:47:58 2010 +0100| [39cbcafd10b4c0451ca84328c535f9d3d560f776] | committer: Laurent Aimar 

Fixed potential division by 0 in vout_AllocatePicture.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=39cbcafd10b4c0451ca84328c535f9d3d560f776
---

 src/video_output/vout_pictures.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/video_output/vout_pictures.c b/src/video_output/vout_pictures.c
index 2ac077c..98b8e41 100644
--- a/src/video_output/vout_pictures.c
+++ b/src/video_output/vout_pictures.c
@@ -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;




More information about the vlc-devel mailing list