mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
Fix a couple of Windows 2Gig file size issues.
Patch submitted by Janne Hyvärinen <cse@sci.fi>.
This commit is contained in:
@@ -61,11 +61,17 @@ void grabbag__file_copy_metadata(const char *srcpath, const char *destpath)
|
||||
}
|
||||
}
|
||||
|
||||
off_t grabbag__file_get_filesize(const char *srcpath)
|
||||
FLAC__off_t grabbag__file_get_filesize(const char *srcpath)
|
||||
{
|
||||
#if defined _MSC_VER || defined __MINGW32__
|
||||
struct _stat64 srcstat;
|
||||
|
||||
if(0 == _stat64(srcpath, &srcstat))
|
||||
#else
|
||||
struct stat srcstat;
|
||||
|
||||
if(0 == stat(srcpath, &srcstat))
|
||||
#endif
|
||||
return srcstat.st_size;
|
||||
else
|
||||
return -1;
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "share/compat.h"
|
||||
|
||||
/* slightly different that strndup(): this always copies 'size' bytes starting from s into a NUL-terminated string. */
|
||||
static char *local__strndup_(const char *s, size_t size)
|
||||
@@ -356,7 +357,7 @@ FLAC__StreamMetadata *grabbag__picture_parse_specification(const char *spec, con
|
||||
*error_message = error_messages[3];
|
||||
}
|
||||
else { /* regular picture file */
|
||||
const off_t size = grabbag__file_get_filesize(spec);
|
||||
const FLAC__off_t size = grabbag__file_get_filesize(spec);
|
||||
if(size < 0)
|
||||
*error_message = error_messages[5];
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user