diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 73c6660a55..e9774f0301 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -974,7 +974,7 @@ static int read_block(ALSDecContext *ctx, ALSBlockData *bd)
     *bd->shift_lsbs = 0;
     // read block type flag and read the samples accordingly
     if (get_bits1(gb)) {
-        if (read_var_block_data(ctx, bd))
+        if (read_var_block_data(ctx, bd) < 0)
             return -1;
     } else {
         if (read_const_block_data(ctx, bd) < 0)