summaryrefslogtreecommitdiff
path: root/libavcodec/h263dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-05-22 19:06:10 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-05-22 21:31:27 +0200
commita0cd98b5943a7807aff837f9adba1dd034ec2272 (patch)
treef6889b730bac76a7890b14956b8a9eb98743d256 /libavcodec/h263dec.c
parent94ea17075ba0751a4ac0f9fa0929956a18497b5a (diff)
downloadffmpeg-a0cd98b5943a7807aff837f9adba1dd034ec2272.tar.gz
Fix ticket127
This fixes detectiion of slightly too big dummy frames. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h263dec.c')
-rw-r--r--libavcodec/h263dec.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index b56fd06516..bf6a856796 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -681,22 +681,18 @@ retry:
frame_end:
/* divx 5.01+ bistream reorder stuff */
if(s->codec_id==CODEC_ID_MPEG4 && s->divx_packed){
- int current_pos= get_bits_count(&s->gb)>>3;
+ int current_pos= s->gb.buffer == s->bitstream_buffer ? 0 : (get_bits_count(&s->gb)>>3);
int startcode_found=0;
if(buf_size - current_pos > 5){
int i;
- for(i=current_pos; i<buf_size-3; i++){
+ for(i=current_pos; i<buf_size-4; i++){
if(buf[i]==0 && buf[i+1]==0 && buf[i+2]==1 && buf[i+3]==0xB6){
- startcode_found=1;
+ startcode_found=!(buf[i+4]&0x40);
break;
}
}
}
- if(s->gb.buffer == s->bitstream_buffer && buf_size>7 && s->xvid_build>=0){ //xvid style
- startcode_found=1;
- current_pos=0;
- }
if(startcode_found){
av_fast_malloc(