X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Flibaomdec.c;h=1430a651fea1de67efa6d3e647bbb9c2eb68ceed;hb=7b0832dea8fe266011e2891402e091562edbb6ba;hp=a72ac984e72a9f7ea24227d79c1d9ce9f66e975c;hpb=fda424b300c1a0b991296aa585691609d01196bd;p=ffmpeg diff --git a/libavcodec/libaomdec.c b/libavcodec/libaomdec.c index a72ac984e72..1430a651fea 100644 --- a/libavcodec/libaomdec.c +++ b/libavcodec/libaomdec.c @@ -197,6 +197,14 @@ static int aom_decode(AVCodecContext *avctx, void *data, int *got_frame, } if ((ret = ff_get_buffer(avctx, picture, 0)) < 0) return ret; + + av_reduce(&picture->sample_aspect_ratio.num, + &picture->sample_aspect_ratio.den, + picture->height * img->r_w, + picture->width * img->r_h, + INT_MAX); + ff_set_sar(avctx, picture->sample_aspect_ratio); + if ((img->fmt & AOM_IMG_FMT_HIGHBITDEPTH) && img->bit_depth == 8) image_copy_16_to_8(picture, img); else