Commit 1818a113 authored by Michael Niedermayer's avatar Michael Niedermayer

alsdec: propagate error codes in read_block()

Reviewed-by: 's avatarThilo Borgmann <thilo.borgmann@googlemail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 0213d5ad
......@@ -970,15 +970,16 @@ static int decode_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
static int read_block(ALSDecContext *ctx, ALSBlockData *bd)
{
GetBitContext *gb = &ctx->gb;
int ret;
*bd->shift_lsbs = 0;
// read block type flag and read the samples accordingly
if (get_bits1(gb)) {
if (read_var_block_data(ctx, bd) < 0)
return -1;
if ((ret = read_var_block_data(ctx, bd)) < 0)
return ret;
} else {
if (read_const_block_data(ctx, bd) < 0)
return -1;
if ((ret = read_const_block_data(ctx, bd)) < 0)
return ret;
}
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment