[FFmpeg-cvslog] mpeg4videoenc: ensure SAR is within the supported range

Michael Niedermayer git at videolan.org
Tue Jul 31 03:15:59 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Jul 31 01:57:18 2012 +0200| [30c8573dc7d6556096103d5376aa6dea3216b0a7] | committer: Michael Niedermayer

mpeg4videoenc: ensure SAR is within the supported range

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=30c8573dc7d6556096103d5376aa6dea3216b0a7
---

 libavcodec/mpeg4videoenc.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/mpeg4videoenc.c b/libavcodec/mpeg4videoenc.c
index e073746..cbf84b7 100644
--- a/libavcodec/mpeg4videoenc.c
+++ b/libavcodec/mpeg4videoenc.c
@@ -969,6 +969,8 @@ static void mpeg4_encode_vol_header(MpegEncContext * s, int vo_number, int vol_n
 
     put_bits(&s->pb, 4, s->aspect_ratio_info);/* aspect ratio info */
     if (s->aspect_ratio_info == FF_ASPECT_EXTENDED){
+        av_reduce(&s->avctx->sample_aspect_ratio.num, &s->avctx->sample_aspect_ratio.den,
+                   s->avctx->sample_aspect_ratio.num,  s->avctx->sample_aspect_ratio.den, 255);
         put_bits(&s->pb, 8, s->avctx->sample_aspect_ratio.num);
         put_bits(&s->pb, 8, s->avctx->sample_aspect_ratio.den);
     }



More information about the ffmpeg-cvslog mailing list