1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

FlacAudioFormat: Use FLAC version 1.3.4

This commit replaces the contents of the flac directory with the
unchanged contents of the flac_134 directory.
This commit is contained in:
attila 2022-09-05 13:13:21 +02:00 committed by Attila Szarvas
parent 3810252ae2
commit 372290d352
96 changed files with 2561 additions and 26908 deletions

View file

@ -1,6 +1,6 @@
/* alloc - Convenience routines for safely allocating memory
* Copyright (C) 2007-2009 Josh Coalson
* Copyright (C) 2011-2014 Xiph.Org Foundation
* Copyright (C) 2011-2016 Xiph.Org Foundation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -55,7 +55,7 @@
# ifndef SIZE_T_MAX
# ifdef _MSC_VER
# ifdef _WIN64
# define SIZE_T_MAX 0xffffffffffffffffui64
# define SIZE_T_MAX FLAC__U64L(0xffffffffffffffff)
# else
# define SIZE_T_MAX 0xffffffff
# endif
@ -156,11 +156,21 @@ static inline void *safe_malloc_muladd2_(size_t size1, size_t size2, size_t size
return malloc(size1*size2);
}
static inline void *safe_realloc_(void *ptr, size_t size)
{
void *oldptr = ptr;
void *newptr = realloc(ptr, size);
if(size > 0 && newptr == 0)
free(oldptr);
return newptr;
}
static inline void *safe_realloc_add_2op_(void *ptr, size_t size1, size_t size2)
{
size2 += size1;
if(size2 < size1)
if(size2 < size1) {
free(ptr);
return 0;
}
return realloc(ptr, size2);
}
@ -195,7 +205,7 @@ static inline void *safe_realloc_mul_2op_(void *ptr, size_t size1, size_t size2)
return realloc(ptr, 0); /* preserve POSIX realloc(ptr, 0) semantics */
if(size1 > SIZE_MAX / size2)
return 0;
return realloc(ptr, size1*size2);
return safe_realloc_(ptr, size1*size2);
}
/* size1 * (size2 + size3) */