Commit 4cc2404c authored by Rafaël Carré's avatar Rafaël Carré

transcode: reduce decoder aspect ratio fraction

avoids integer overflow with aspect ratio = BIG:BIG
fixes #4312
parent 7853e28d
...@@ -495,6 +495,12 @@ static void transcode_video_encoder_init( sout_stream_t *p_stream, ...@@ -495,6 +495,12 @@ static void transcode_video_encoder_init( sout_stream_t *p_stream,
if( id->p_encoder->fmt_out.video.i_sar_num <= 0 || if( id->p_encoder->fmt_out.video.i_sar_num <= 0 ||
id->p_encoder->fmt_out.video.i_sar_den <= 0 ) id->p_encoder->fmt_out.video.i_sar_den <= 0 )
{ {
vlc_ureduce( &id->p_decoder->fmt_out.video.i_sar_num,
&id->p_decoder->fmt_out.video.i_sar_den,
id->p_decoder->fmt_out.video.i_sar_num,
id->p_decoder->fmt_out.video.i_sar_den,
0 );
id->p_encoder->fmt_out.video.i_sar_num = id->p_decoder->fmt_out.video.i_sar_num * i_src_width / i_dst_width; id->p_encoder->fmt_out.video.i_sar_num = id->p_decoder->fmt_out.video.i_sar_num * i_src_width / i_dst_width;
id->p_encoder->fmt_out.video.i_sar_den = id->p_decoder->fmt_out.video.i_sar_den * i_src_height / i_dst_height; id->p_encoder->fmt_out.video.i_sar_den = id->p_decoder->fmt_out.video.i_sar_den * i_src_height / i_dst_height;
} }
......
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