Commit 7f45f7fc authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/mpeg12dec: use the correct dimensions for checking SAR

Fixes Ticket4533
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 6ef3426d
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <inttypes.h> #include <inttypes.h>
#include "libavutil/attributes.h" #include "libavutil/attributes.h"
#include "libavutil/imgutils.h"
#include "libavutil/internal.h" #include "libavutil/internal.h"
#include "libavutil/stereo3d.h" #include "libavutil/stereo3d.h"
...@@ -1315,7 +1316,13 @@ static int mpeg_decode_postinit(AVCodecContext *avctx) ...@@ -1315,7 +1316,13 @@ static int mpeg_decode_postinit(AVCodecContext *avctx)
} }
} // MPEG-2 } // MPEG-2
ff_set_sar(s->avctx, s->avctx->sample_aspect_ratio); if (av_image_check_sar(s->width, s->height,
avctx->sample_aspect_ratio) < 0) {
av_log(avctx, AV_LOG_WARNING, "ignoring invalid SAR: %u/%u\n",
avctx->sample_aspect_ratio.num,
avctx->sample_aspect_ratio.den);
avctx->sample_aspect_ratio = (AVRational){ 0, 1 };
}
if ((s1->mpeg_enc_ctx_allocated == 0) || if ((s1->mpeg_enc_ctx_allocated == 0) ||
avctx->coded_width != s->width || avctx->coded_width != s->width ||
......
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