summaryrefslogtreecommitdiffstats
path: root/src/file_mpg.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/file_mpg.c')
-rw-r--r--src/file_mpg.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/file_mpg.c b/src/file_mpg.c
index 22f8e5b..2c50075 100644
--- a/src/file_mpg.c
+++ b/src/file_mpg.c
@@ -59,6 +59,8 @@ static int header_check_mpg(const unsigned char *buffer, const unsigned int buff
* STREAM AND HEADERS *
* 0x000001BA pack header start code *
* 0x000001BB system header start code *
+ * 2 bytes: header_size
+ * 1 byte: stream_id
* 0x000001BE padding block start code *
* 0x000001BD private 1 block start code *
* 0x000001BF private 2 block start code *
@@ -75,7 +77,9 @@ static int header_check_mpg(const unsigned char *buffer, const unsigned int buff
if(buffer[0]==0x00 && buffer[1]==0x00 && buffer[2]==0x01 &&
(buffer[3]==0xB0 ||
(buffer[3]==0xB3 && ((buffer[4]<<8)+(buffer[5]>>8)>0) && ((buffer[5]<<8)+buffer[6]>0)) ||
- buffer[3]==0xB5 || buffer[3]==0xBA || buffer[3]==0xBB))
+ buffer[3]==0xB5 ||
+ buffer[3]==0xBA ||
+ (buffer[3]==0xBB && (buffer[4]<<8)+(buffer[5]>>8)>0 && (buffer[6]&0x80)==0x80)))
{
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_mpg.extension;