Commit fd002035 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/flacdec: Check for invalid vlcs

Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 8addd565
......@@ -259,7 +259,13 @@ static int decode_residuals(FLACContext *s, int32_t *decoded, int pred_order)
*decoded++ = get_sbits_long(&s->gb, tmp);
} else {
for (; i < samples; i++) {
*decoded++ = get_sr_golomb_flac(&s->gb, tmp, INT_MAX, 0);
int v = get_sr_golomb_flac(&s->gb, tmp, INT_MAX, 0);
if (v == 0x80000000){
av_log(s->avctx, AV_LOG_ERROR, "invalid residual\n");
return AVERROR_INVALIDDATA;
}
*decoded++ = v;
}
}
i= 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