Commit 39caba70 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
(cherry picked from commit 4cc2404ca5426f522822e4906572bfa7813669cd)
Signed-off-by: default avatarRafaël Carré <rafael.carre@gmail.com>
parent 9f777cc6
...@@ -435,6 +435,12 @@ static void transcode_video_encoder_init( sout_stream_t *p_stream, ...@@ -435,6 +435,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