Commit 73fb23dc authored by Michael Niedermayer's avatar Michael Niedermayer

mpeg12_parser: make mpegvideo_split() more robust

I just found this issue while debuging, i dont have a testcase.
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 4e3303cf
...@@ -164,10 +164,13 @@ static int mpegvideo_split(AVCodecContext *avctx, ...@@ -164,10 +164,13 @@ static int mpegvideo_split(AVCodecContext *avctx,
{ {
int i; int i;
uint32_t state= -1; uint32_t state= -1;
int found=0;
for(i=0; i<buf_size; i++){ for(i=0; i<buf_size; i++){
state= (state<<8) | buf[i]; state= (state<<8) | buf[i];
if(state != 0x1B3 && state != 0x1B5 && state < 0x200 && state >= 0x100) if(state == 0x1B3){
found=1;
}else if(found && state != 0x1B5 && state < 0x200 && state >= 0x100)
return i-3; return i-3;
} }
return 0; return 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