Commit 40f02514 authored by michael's avatar michael

Check level_prefix a bit (this just checks the max our bitreader can handle,

as i did nt find a limit in the spec)
This should stop cavlc_decode_residual() on a zero bitstream


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@22429 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 8709a539
......@@ -431,8 +431,13 @@ static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, in
level_code= prefix + get_bits(gb, 4); //part
}else{
level_code= 30 + get_bits(gb, prefix-3); //part
if(prefix>=16)
if(prefix>=16){
if(prefix > 25+3){
av_log(h->s.avctx, AV_LOG_ERROR, "Invalid level prefix\n");
return -1;
}
level_code += (1<<(prefix-3))-4096;
}
}
if(trailing_ones < 3) level_code += 2;
......
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