[FFmpeg-cvslog] lavc/mjpegdec: Set SAR even if no resolution is available.
Carl Eugen Hoyos
git at videolan.org
Wed Jan 27 10:24:54 CET 2016
ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Wed Jan 27 10:23:37 2016 +0100| [7a90edc188a73cf5bfc029641a86634ae9c2aa3f] | committer: Carl Eugen Hoyos
lavc/mjpegdec: Set SAR even if no resolution is available.
Fixes ticket #4479.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7a90edc188a73cf5bfc029641a86634ae9c2aa3f
---
libavcodec/mjpegdec.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 863738d..a51c580 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1653,7 +1653,11 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
s->avctx->sample_aspect_ratio.num = get_bits(&s->gb, 16);
s->avctx->sample_aspect_ratio.den = get_bits(&s->gb, 16);
- ff_set_sar(s->avctx, s->avctx->sample_aspect_ratio);
+ if ( s->avctx->sample_aspect_ratio.num <= 0
+ || s->avctx->sample_aspect_ratio.den <= 0) {
+ s->avctx->sample_aspect_ratio.num = 0;
+ s->avctx->sample_aspect_ratio.den = 1;
+ }
if (s->avctx->debug & FF_DEBUG_PICT_INFO)
av_log(s->avctx, AV_LOG_INFO,
More information about the ffmpeg-cvslog
mailing list