summaryrefslogtreecommitdiffstats
path: root/src/file_riff.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2013-12-14 21:36:24 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2013-12-14 21:40:04 +0100
commit3213247d998d58627eb4029afce6be8680de3b30 (patch)
tree96d4a64aca2201410703b5c15589715fe1557aa1 /src/file_riff.c
parent5de0329f2184bdf89e087f414b651448df096c1f (diff)
PhotoRec: use an enum for values returned by data_check()
rename .m2ts and .ts using pid from header
Diffstat (limited to 'src/file_riff.c')
-rw-r--r--src/file_riff.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/file_riff.c b/src/file_riff.c
index 77b811c..e1c591e 100644
--- a/src/file_riff.c
+++ b/src/file_riff.c
@@ -34,7 +34,7 @@
#include "log.h"
#endif
-int data_check_avi_stream(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery);
+data_check_t data_check_avi_stream(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery);
static void register_header_check_riff(file_stat_t *file_stat);
const file_hint_t file_hint_riff= {
@@ -171,7 +171,7 @@ static void file_check_avi(file_recovery_t *fr)
}
}
-static int data_check_avi(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery)
+static data_check_t data_check_avi(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery)
{
while(file_recovery->calculated_file_size + buffer_size/2 >= file_recovery->file_size &&
file_recovery->calculated_file_size + 12 < file_recovery->file_size + buffer_size/2)
@@ -181,12 +181,12 @@ static int data_check_avi(const unsigned char *buffer, const unsigned int buffer
if(memcmp(&buffer[i], "RIFF", 4)==0 && memcmp(&buffer[i+8], "AVIX", 4)==0)
file_recovery->calculated_file_size += 8 + le32(chunk_header->dwSize);
else
- return 2;
+ return DC_STOP;
}
- return 1;
+ return DC_CONTINUE;
}
-int data_check_avi_stream(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery)
+data_check_t data_check_avi_stream(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery)
{
while(file_recovery->calculated_file_size + buffer_size/2 >= file_recovery->file_size &&
file_recovery->calculated_file_size + 8 < file_recovery->file_size + buffer_size/2)
@@ -194,10 +194,10 @@ int data_check_avi_stream(const unsigned char *buffer, const unsigned int buffer
const unsigned int i=file_recovery->calculated_file_size - file_recovery->file_size + buffer_size/2;
const riff_chunk_header *chunk_header=(const riff_chunk_header*)&buffer[i];
if(buffer[i+2]!='d' || buffer[i+3]!='b') /* Video Data Binary ?*/
- return 2;
+ return DC_STOP;
file_recovery->calculated_file_size += 8 + le32(chunk_header->dwSize);
}
- return 1;
+ return DC_CONTINUE;
}
static void file_check_size_rifx(file_recovery_t *file_recovery)