Commit a4d08390 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* backport [18732]

 Don't crash on messed up aspect ratios
parent 73b0067b
...@@ -801,7 +801,12 @@ static void InitWindowSize( vout_thread_t *p_vout, unsigned *pi_width, ...@@ -801,7 +801,12 @@ static void InitWindowSize( vout_thread_t *p_vout, unsigned *pi_width,
goto initwsize_end; goto initwsize_end;
} }
if( p_vout->fmt_in.i_sar_num >= p_vout->fmt_in.i_sar_den ) if( p_vout->fmt_in.i_sar_num == 0 || p_vout->fmt_in.i_sar_den == 0 ) {
msg_Warn( p_vout, "fucked up aspect" );
*pi_width = (int)( p_vout->fmt_in.i_visible_width * ll_zoom / FP_FACTOR );
*pi_height = (int)( p_vout->fmt_in.i_visible_height * ll_zoom /FP_FACTOR);
}
else if( p_vout->fmt_in.i_sar_num >= p_vout->fmt_in.i_sar_den )
{ {
*pi_width = (int)( p_vout->fmt_in.i_visible_width * ll_zoom * *pi_width = (int)( p_vout->fmt_in.i_visible_width * ll_zoom *
p_vout->fmt_in.i_sar_num / p_vout->fmt_in.i_sar_den / FP_FACTOR ); p_vout->fmt_in.i_sar_num / p_vout->fmt_in.i_sar_den / FP_FACTOR );
......
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