Commit d8ac16fb authored by Gildas Bazin's avatar Gildas Bazin

* src/video_output/vout_pictures.c: avoid overflow in vout_PlacePicture().

parent 06212a31
...@@ -444,19 +444,19 @@ void vout_PlacePicture( vout_thread_t *p_vout, ...@@ -444,19 +444,19 @@ void vout_PlacePicture( vout_thread_t *p_vout,
*pi_height = __MIN( i_height, p_vout->fmt_in.i_visible_height ); *pi_height = __MIN( i_height, p_vout->fmt_in.i_visible_height );
} }
if( p_vout->fmt_in.i_visible_width * p_vout->fmt_in.i_sar_num * if( p_vout->fmt_in.i_visible_width * (int64_t)p_vout->fmt_in.i_sar_num *
*pi_height / *pi_height /
(p_vout->fmt_in.i_visible_height * p_vout->fmt_in.i_sar_den) > (p_vout->fmt_in.i_visible_height * p_vout->fmt_in.i_sar_den) >
*pi_width ) *pi_width )
{ {
*pi_height = p_vout->fmt_in.i_visible_height * *pi_height = p_vout->fmt_in.i_visible_height *
p_vout->fmt_in.i_sar_den * *pi_width / (int64_t)p_vout->fmt_in.i_sar_den * *pi_width /
(p_vout->fmt_in.i_visible_width * p_vout->fmt_in.i_sar_num); (p_vout->fmt_in.i_visible_width * p_vout->fmt_in.i_sar_num);
} }
else else
{ {
*pi_width = p_vout->fmt_in.i_visible_width * *pi_width = p_vout->fmt_in.i_visible_width *
p_vout->fmt_in.i_sar_num * *pi_height / (int64_t)p_vout->fmt_in.i_sar_num * *pi_height /
(p_vout->fmt_in.i_visible_height * p_vout->fmt_in.i_sar_den); (p_vout->fmt_in.i_visible_height * p_vout->fmt_in.i_sar_den);
} }
......
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