summaryrefslogtreecommitdiffstats
path: root/src/file_riff.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2014-10-04 18:09:48 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2014-10-04 18:09:48 +0200
commitc28950032981dafb83ec5c568a16e030c4467226 (patch)
tree05156e7f64df839808af64cd455c8b864a1eda18 /src/file_riff.c
parent4c5fcd4164b7fd06eafa54fa44ecfb9fb2d02d00 (diff)
Use fseeko() instead of fseek().
Fix 2GB per file limit on Windows for some file types.
Diffstat (limited to 'src/file_riff.c')
-rw-r--r--src/file_riff.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/file_riff.c b/src/file_riff.c
index 5c493ce..5c97df9 100644
--- a/src/file_riff.c
+++ b/src/file_riff.c
@@ -104,7 +104,11 @@ static void check_riff_list(file_recovery_t *fr, const unsigned int depth, const
return;
for(file_size=start; file_size < end;)
{
+#ifdef HAVE_FSEEKO
+ if(fseeko(fr->handle, file_size, SEEK_SET)<0)
+#else
if(fseek(fr->handle, file_size, SEEK_SET)<0)
+#endif
{
fr->offset_error=file_size;
return;
@@ -143,7 +147,11 @@ static void file_check_avi(file_recovery_t *fr)
{
const uint64_t file_size=fr->file_size;
riff_list_header list_header;
+#ifdef HAVE_FSEEKO
+ if(fseeko(fr->handle, fr->file_size, SEEK_SET)<0)
+#else
if(fseek(fr->handle, fr->file_size, SEEK_SET)<0)
+#endif
{
fr->file_size=0;
return ;