Fix snapshot height integer overflow creating mini-snapshots
authorJean-Baptiste Kempf <jb@videolan.org>
Mon, 16 Aug 2010 13:40:52 +0000 (15:40 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Mon, 16 Aug 2010 13:40:52 +0000 (15:40 +0200)
See http://forum.videolan.org/viewtopic.php?f=2&t=81103
http://forum.videolan.org/viewtopic.php?f=14&t=80008
http://forum.videolan.org/viewtopic.php?f=13&t=73500

src/video_output/vout_pictures.c

index 318646e..b2f2e11 100644 (file)
@@ -412,13 +412,13 @@ int picture_Export( vlc_object_t *p_obj,
     unsigned int i_original_height;
     if( fmt_in.i_sar_num >= fmt_in.i_sar_den )
     {
-        i_original_width = fmt_in.i_width * fmt_in.i_sar_num / fmt_in.i_sar_den;
+        i_original_width = (int64_t)fmt_in.i_width * fmt_in.i_sar_num / fmt_in.i_sar_den;
         i_original_height = fmt_in.i_height;
     }
     else
     {
         i_original_width =  fmt_in.i_width;
-        i_original_height = fmt_in.i_height * fmt_in.i_sar_den / fmt_in.i_sar_num;
+        i_original_height = (int64_t)fmt_in.i_height * fmt_in.i_sar_den / fmt_in.i_sar_num;
     }
 
     /* */