Commit ade621d6 authored by michael's avatar michael

fix IPCM_decode_error.h264


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@14135 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 064f3fe8
...@@ -4352,12 +4352,11 @@ static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, in ...@@ -4352,12 +4352,11 @@ static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, in
level_code= (prefix<<suffix_length) + get_bits(gb, suffix_length); //part level_code= (prefix<<suffix_length) + get_bits(gb, suffix_length); //part
else else
level_code= prefix + get_bits(gb, 4); //part level_code= prefix + get_bits(gb, 4); //part
}else if(prefix==15){
level_code= (prefix<<suffix_length) + get_bits(gb, 12); //part
if(suffix_length==0) level_code+=15; //FIXME doesn't make (much)sense
}else{ }else{
av_log(h->s.avctx, AV_LOG_ERROR, "prefix too large at %d %d\n", s->mb_x, s->mb_y); level_code= (15<<suffix_length) + get_bits(gb, prefix-3); //part
return -1; if(suffix_length==0) level_code+=15; //FIXME doesn't make (much)sense
if(prefix>=16)
level_code += (1<<(prefix-3))-4096;
} }
if(trailing_ones < 3) level_code += 2; if(trailing_ones < 3) level_code += 2;
...@@ -4375,11 +4374,10 @@ static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, in ...@@ -4375,11 +4374,10 @@ static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, in
prefix = get_level_prefix(gb); prefix = get_level_prefix(gb);
if(prefix<15){ if(prefix<15){
level_code = (prefix<<suffix_length) + get_bits(gb, suffix_length); level_code = (prefix<<suffix_length) + get_bits(gb, suffix_length);
}else if(prefix==15){
level_code = (prefix<<suffix_length) + get_bits(gb, 12);
}else{ }else{
av_log(h->s.avctx, AV_LOG_ERROR, "prefix too large at %d %d\n", s->mb_x, s->mb_y); level_code = (15<<suffix_length) + get_bits(gb, prefix-3);
return -1; if(prefix>=16)
level_code += (1<<(prefix-3))-4096;
} }
mask= -(level_code&1); mask= -(level_code&1);
level[i]= (((2+level_code)>>1) ^ mask) - mask; level[i]= (((2+level_code)>>1) ^ mask) - mask;
......
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