summaryrefslogtreecommitdiffstats
path: root/src/file_mpg.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2007-12-28 18:49:47 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2007-12-28 18:49:47 +0100
commit2af8072225804ae699fbb6dfa0c4f39935c47201 (patch)
tree43026377ec8817f91ec9ce9644618e7da911d63d /src/file_mpg.c
parent49e7e8a2571f0d1bbae7b21c76ed6a8d160f4718 (diff)
Add new parameter to enable/disable all filetype recovery: photorec /cmd device ...,fileopts,everything,disable"
MPG recovery: check size defined by video sequence start code
Diffstat (limited to 'src/file_mpg.c')
-rw-r--r--src/file_mpg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/file_mpg.c b/src/file_mpg.c
index 9cf6d91..c16aabf 100644
--- a/src/file_mpg.c
+++ b/src/file_mpg.c
@@ -72,7 +72,9 @@ static int header_check_mpg(const unsigned char *buffer, const unsigned int buff
* 0x000001B5 visual object start code */
if(buffer[0]==0x00 && buffer[1]==0x00 && buffer[2]==0x01 &&
- (buffer[3]==0xB0 || buffer[3]==0xB3 || buffer[3]==0xB5 || buffer[3]==0xBA || buffer[3]==0xBB))
+ (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))
{
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_mpg.extension;