avcodec/dct: Propagate error code from ff_rdft_init()
authorMichael Niedermayer <michael@niedermayer.cc>
Mon, 31 Dec 2018 17:51:20 +0000 (18:51 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 1 Jan 2019 20:11:47 +0000 (21:11 +0100)
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/dct.c

index cca51ee..52f082d 100644 (file)
@@ -178,6 +178,7 @@ av_cold int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType inverse)
 {
     int n = 1 << nbits;
     int i;
+    int ret;
 
     memset(s, 0, sizeof(*s));
 
@@ -194,9 +195,9 @@ av_cold int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType inverse)
         if (!s->csc2)
             return AVERROR(ENOMEM);
 
-        if (ff_rdft_init(&s->rdft, nbits, inverse == DCT_III) < 0) {
+        if ((ret = ff_rdft_init(&s->rdft, nbits, inverse == DCT_III)) < 0) {
             av_freep(&s->csc2);
-            return -1;
+            return ret;
         }
 
         for (i = 0; i < n / 2; i++)