Work around i386 ASAN fseek bug

For some reason, i386 ASAN's fseek does not have large file
support, and off_t is actually a 32-bit int
This commit is contained in:
Martijn van Beurden 2024-07-25 15:35:36 +02:00
parent e50c876a1c
commit ce91056644
1 changed files with 7 additions and 0 deletions

View File

@ -2892,6 +2892,13 @@ FLAC__bool fskip_ahead(FILE *f, FLAC__uint64 offset)
static uint8_t dump[8192];
struct flac_stat_s stb;
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
#ifdef __i386__
/* Work around i386 ASAN bug */
if(offset > (FLAC__uint64)(INT32_MAX)) return false;
#endif
#endif
if(flac_fstat(fileno(f), &stb) == 0 && (stb.st_mode & S_IFMT) == S_IFREG)
{
if(fseeko(f, offset, SEEK_CUR) == 0)