diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-06-20 23:02:52 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-06-20 23:02:52 +0200 |
commit | fe43facd659f4bf04871d7736701011ebad98932 (patch) | |
tree | 4367e82239b2ea69ae9baa0f1f0693d28c911e9b /libavcodec/utils.c | |
parent | 0dceefc5fa81a6c851b51acab695a8c149ec8e3b (diff) | |
download | ffmpeg-fe43facd659f4bf04871d7736701011ebad98932.tar.gz |
avcodec/utils: check sar only when width/height are set
This fixes loosing the perfectly valid SAR when width=height=0
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 9005f27bde..32af2569e4 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -819,7 +819,8 @@ int ff_init_buffer_info(AVCodecContext *avctx, AVFrame *frame) if (!frame->sample_aspect_ratio.num) frame->sample_aspect_ratio = avctx->sample_aspect_ratio; - if (av_image_check_sar(frame->width, frame->height, + if (frame->width && frame->height && + av_image_check_sar(frame->width, frame->height, frame->sample_aspect_ratio) < 0) { av_log(avctx, AV_LOG_WARNING, "ignoring invalid SAR: %u/%u\n", frame->sample_aspect_ratio.num, |