summaryrefslogtreecommitdiffstats
path: root/src/file_mpg.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2011-06-17 08:01:29 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2011-06-17 08:01:29 +0200
commit5a0b723bd0e098e13f5c4d5925c8fa596f1a0bed (patch)
treeaa0b6216e4298b168b989bc55c074b16bacc2343 /src/file_mpg.c
parent5a50a1d6f46be26e7125f942d9811bf7a959affd (diff)
MPG recovery: try to avoid to concatenate several MPG files
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 e6f9862..df8aeda 100644
--- a/src/file_mpg.c
+++ b/src/file_mpg.c
@@ -54,7 +54,9 @@ static void register_header_check_mpg(file_stat_t *file_stat)
static int header_check_mpg(const unsigned char *buffer, const unsigned int buffer_size, const unsigned int safe_header_only, const file_recovery_t *file_recovery, file_recovery_t *file_recovery_new)
{
- if(file_recovery!=NULL && file_recovery->file_stat!=NULL && file_recovery->file_stat->file_hint==&file_hint_mpg)
+ if(file_recovery!=NULL && file_recovery->file_stat!=NULL && file_recovery->file_stat->file_hint==&file_hint_mpg &&
+ !(buffer[0]==0x00 && buffer[1]==0x00 && buffer[2]==0x01 &&
+ buffer[3]==0xBA && (buffer[4]&0xF1)==0x21 && buffer[5]==0 && buffer[6]==1 && buffer[7]==0 && buffer[8]==1))
return 0;
/* MPEG-1 http://andrewduncan.ws/MPEG/MPEG-1.ps
* MPEG-2 Program stream http://neuron2.net/library/mpeg2/iso13818-1.pdf