aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-10-18 14:08:06 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-18 14:08:06 +0200
commit73fb23dc5a5b0d91491c8c4645134e2f7a9e6965 (patch)
tree651c91902b85178b1c74cb3bb62527d77595ed1e
parent4e3303cf3162ec38f39fe2f264e8d5c845e30d2b (diff)
downloadffmpeg-73fb23dc5a5b0d91491c8c4645134e2f7a9e6965.tar.gz
mpeg12_parser: make mpegvideo_split() more robust
I just found this issue while debuging, i dont have a testcase. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/mpegvideo_parser.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/mpegvideo_parser.c b/libavcodec/mpegvideo_parser.c
index bcbe1f112d..25028a9eb1 100644
--- a/libavcodec/mpegvideo_parser.c
+++ b/libavcodec/mpegvideo_parser.c
@@ -164,10 +164,13 @@ static int mpegvideo_split(AVCodecContext *avctx,
{
int i;
uint32_t state= -1;
+ int found=0;
for(i=0; i<buf_size; 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 0;