aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/alsdec.c
diff options
context:
space:
mode:
authorThilo Borgmann <thilo.borgmann@googlemail.com>2012-03-27 18:06:54 +0200
committerJustin Ruggles <justin.ruggles@gmail.com>2012-09-17 14:17:27 -0400
commitac3f5a6879396680c616eabba13609c753939070 (patch)
tree35e66d5605f492e9c3aca76f5ea7b3cfc2813d9d /libavcodec/alsdec.c
parent66197988b1ee914825afbc3084e6da63f862068a (diff)
downloadffmpeg-ac3f5a6879396680c616eabba13609c753939070.tar.gz
alsdec: check return values.
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
Diffstat (limited to 'libavcodec/alsdec.c')
-rw-r--r--libavcodec/alsdec.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 02307795fb..dce76b0a71 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -1348,7 +1348,7 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
}
} else { // multi-channel coding
ALSBlockData bd = { 0 };
- int b;
+ int b, ret;
int *reverted_channels = ctx->reverted_channels;
unsigned int offset = 0;
@@ -1381,9 +1381,10 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
bd.raw_samples = ctx->raw_samples[c] + offset;
bd.raw_other = NULL;
- read_block(ctx, &bd);
- if (read_channel_data(ctx, ctx->chan_data[c], c))
- return -1;
+ if ((ret = read_block(ctx, &bd)) < 0)
+ return ret;
+ if ((ret = read_channel_data(ctx, ctx->chan_data[c], c)) < 0)
+ return ret;
}
for (c = 0; c < avctx->channels; c++)
@@ -1402,7 +1403,8 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
bd.lpc_cof = ctx->lpc_cof[c];
bd.quant_cof = ctx->quant_cof[c];
bd.raw_samples = ctx->raw_samples[c] + offset;
- decode_block(ctx, &bd);
+ if ((ret = decode_block(ctx, &bd)) < 0)
+ return ret;
}
memset(reverted_channels, 0, avctx->channels * sizeof(*reverted_channels));