summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrobi6 <robi6@users.sourceforge.net>2014-09-03 00:04:48 +0200
committerrobi6 <robi6@users.sourceforge.net>2014-09-03 00:04:48 +0200
commit9f94813b8cff212e30a859b483a9f368f9535570 (patch)
tree98b45d9335cc832251c4ecdcc9db3361995fe598 /src
parentacf30075fff6dafc9ac5cdf7c3d66372fb809130 (diff)
prevent endless loops on raw mpeg video
Diffstat (limited to 'src')
-rw-r--r--src/file_type.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/file_type.c b/src/file_type.c
index 2027741..35a7a9c 100644
--- a/src/file_type.c
+++ b/src/file_type.c
@@ -4839,6 +4839,7 @@ static int follow_flac(unsigned char *buf, __u16 blockcount, __u32 *offset, __u3
f_offset += 4;
p_data->flag = 3;
case 3:
+ if (p_data->begin == f_offset) f_offset += 2;
while (( f_offset < (end -4)) && ((f_offset - p_data->begin)< p_data->max_blocks) &&
(!((buf[f_offset] == 0xff) && ((buf[f_offset+1] & 0xfd) == 0xf8) &&
(p_data->b_head[2] == buf[f_offset+2]) && ((p_data->b_head[3]&0x0f) == (buf[f_offset+3]&0x0f))))){
@@ -5237,7 +5238,8 @@ static int follow_mpeg(unsigned char *buf, __u16 blockcount, __u32 *offset, __u3
while (((frame_offset + tmp + 4) < end) && (buf[frame_offset + tmp] || buf[frame_offset + tmp +1] || (buf[frame_offset+ tmp +2] != 0x01)))
tmp++;
if ((frame_offset + tmp + 4) >= end)
- ret = 8;
+// ret=8;
+ ret =((10*current_fs->blocksize)<=tmp)?0:8;
else{
if (((buf[frame_offset + tmp +3]) < 0xb9) && (tmp < 9500)) //max slice size ???????
frame_offset += tmp;