]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/diracdec.c
Merge commit '458e53f51fc75d08df884f8e9eb3d7ded23e97b3'
[ffmpeg] / libavcodec / diracdec.c
index 000abf7d5a7f1abd1e1560f8711bdde10f02f1cb..486c1b3ad7e2fa0fa0c2306c187be12ad8f5947d 100644 (file)
@@ -1989,7 +1989,13 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int
             return ret;
         }
 
-        ff_set_dimensions(avctx, dsh->width, dsh->height);
+        ret = ff_set_dimensions(avctx, dsh->width, dsh->height);
+        if (ret < 0) {
+            av_freep(&dsh);
+            return ret;
+        }
+
+        ff_set_sar(avctx, dsh->sample_aspect_ratio);
         avctx->pix_fmt         = dsh->pix_fmt;
         avctx->color_range     = dsh->color_range;
         avctx->color_trc       = dsh->color_trc;