Skip to content
Snippets Groups Projects
Commit 23aae62c authored by Michael Niedermayer's avatar Michael Niedermayer Committed by Justin Ruggles
Browse files

alsdec: Check k used for rice decoder.


Values that fail this check will cause failure of decode_rice()

Signed-off-by: default avatarMichael Niedermayer <michaelni@gmx.at>
Signed-off-by: default avatarJustin Ruggles <justin.ruggles@gmail.com>
parent e3496e5d
No related branches found
No related tags found
No related merge requests found
...@@ -651,6 +651,11 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd) ...@@ -651,6 +651,11 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
for (k = 1; k < sub_blocks; k++) for (k = 1; k < sub_blocks; k++)
s[k] = s[k - 1] + decode_rice(gb, 0); s[k] = s[k - 1] + decode_rice(gb, 0);
} }
for (k = 1; k < sub_blocks; k++)
if (s[k] > 32) {
av_log(avctx, AV_LOG_ERROR, "k invalid for rice code.\n");
return AVERROR_INVALIDDATA;
}
if (get_bits1(gb)) if (get_bits1(gb))
*bd->shift_lsbs = get_bits(gb, 4) + 1; *bd->shift_lsbs = get_bits(gb, 4) + 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment