summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2016-01-27 10:23:37 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2016-01-27 10:23:37 +0100
commit7a90edc188a73cf5bfc029641a86634ae9c2aa3f (patch)
tree5af44593a266a06b373bffd3a0868126cd5d75fe
parent69dbecf920f6fe7e5a7fc0b38ecaeeb444bc1d7a (diff)
lavc/mjpegdec: Set SAR even if no resolution is available.
Fixes ticket #4479.
-rw-r--r--libavcodec/mjpegdec.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 863738d916..a51c580006 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,