[FFmpeg-devel] [PATCH 13/16] avcodec/dct: Propagate error code from ff_rdft_init()

Michael Niedermayer michael at niedermayer.cc
Mon Dec 31 20:22:43 EET 2018


Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavcodec/dct.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/dct.c b/libavcodec/dct.c
index cca51eeaf8..52f082d062 100644
--- a/libavcodec/dct.c
+++ b/libavcodec/dct.c
@@ -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++)
-- 
2.20.1



More information about the ffmpeg-devel mailing list