diff mbox

[FFmpeg-devel,14/16] avcodec/dcaenc: Return specific error code from subband_bufer_alloc()

Message ID 20181231182246.14327-14-michael@niedermayer.cc
State Accepted
Commit 8b1099c288ab162f4316a8c1ae269f216520f52d
Headers show

Commit Message

Michael Niedermayer Dec. 31, 2018, 6:22 p.m. UTC
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/dcaenc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/libavcodec/dcaenc.c b/libavcodec/dcaenc.c
index 4b4ceeff05..34b3e94165 100644
--- a/libavcodec/dcaenc.c
+++ b/libavcodec/dcaenc.c
@@ -136,7 +136,7 @@  static int subband_bufer_alloc(DCAEncContext *c)
                                (SUBBAND_SAMPLES + DCA_ADPCM_COEFFS),
                                sizeof(int32_t));
     if (!bufer)
-        return -1;
+        return AVERROR(ENOMEM);
 
     /* we need a place for DCA_ADPCM_COEFF samples from previous frame
      * to calc prediction coefficients for each subband */
@@ -166,8 +166,8 @@  static int encode_init(AVCodecContext *avctx)
     int i, j, k, min_frame_bits;
     int ret;
 
-    if (subband_bufer_alloc(c))
-        return AVERROR(ENOMEM);
+    if ((ret = subband_bufer_alloc(c)) < 0)
+        return ret;
 
     c->fullband_channels = c->channels = avctx->channels;
     c->lfe_channel = (avctx->channels == 3 || avctx->channels == 6);