]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/utils: check sar only when width/height are set
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 20 Jun 2014 21:02:52 +0000 (23:02 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 20 Jun 2014 21:02:52 +0000 (23:02 +0200)
This fixes loosing the perfectly valid SAR when width=height=0

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/utils.c

index 9005f27bde8b29806b74e9aa55003e01daf903b2..32af2569e49e9ef1b9c209a95460c4ec36741e85 100644 (file)
@@ -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,