| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Parts of the code use realloc like
x = safe_realloc(x, somesize);
when this is the case, the safe_realloc variant used must free the
old memory block in case it fails, otherwise it will leak. However,
there are also instances in the code where handling is different:
if (0 == (x = safe_realloc(y, somesize)))
return false
in this case, y should not be freed, as y is not set to NULL we
could encounter double frees. Here the safe_realloc_nofree
functions are used.
|
| |
|
|
|
|
| |
This fixes https://github.com/xiph/flac/issues/370
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the past, various bugs have triggered libFLAC to write enormous
coded residuals. While these bugs have been fixed, this check is
added to limit the impact of possible remaining or future bugs
When a bitwriter is grown past the maximum sane size of a frame
(8 channels of 65535 samples with 24 + 4 bits per sample) this
indicates that such a bug was triggered. Instead of a possible
crash or creating unreadable files, bitwriter_grow_ fails as if
it could not allocate more memory.
|
| |
|
|
|
|
| |
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
|
|
|
|
|
|
|
| |
As pointed out by Ozkan Sezer, on some platforms `int32_t` is actually
a typedef for `long` so `unsigned` cannot be used interchangably with
`FLAC__uint32`. Fix is to switch from `unsigned` to explicit sized ISO
C types defined in <stdint.h>.
|
| |
|
|
|
|
|
|
|
|
|
| |
* Removes unused FLAC__WORD_ALL_ONES definition.
* Add comment that unused bits of accumulator can contain garbage.
* Turn assert inside FLAC__bitwriter_write_utf8_uint32 into runtime
check (similar to FLAC__bitwriter_write_utf8_uint64() function).
Patch-from: lvqcl <lvqcl.mail@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The old version of `FLAC__bitwriter_write_raw_uint32()` assumes that the
unused bits of the `val` argument are equal to zero, but don't check it.
This patch adds a new version of that function which does have the check
and then calls a new function `FLAC__bitwriter_write_raw_uint32_nocheck()`
which behaves like the old one.
Code updated to use these two functions as needed.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
|
|
|
|
|
| |
The old 32 bit words the default which can be overridded with this
configure option.
|
|
|
|
|
|
|
| |
This patch allows FLAC__BYTES_PER_WORD to be set to 8, but is disabled by
default.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
|
|
|
|
|
|
|
| |
Assertions added, assertions simplified, unnecessary assignments
removed, mask calculations improved.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
|
|
|
|
| |
Patch-from: lvqcl <lvqcl.mail@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When doing a flac to flac conversion, bad data read from the input file
was making it all the way through the encoder to cause a read past the
end of the buffer in the CRC calculation.
Fix had two parts:
* bitwriter.c: Make a debug only assert (assert bits < 32) into a proper
failure.
* stream_encoder.c: Catch the error condition of wasted bits being greater
that bits_pers_sample and limit it to the bits_per_sample value.
Found using the American Fuzzy Lop fuzzer.
|
| |
|
|
|
|
| |
Improve folding of signed to unsgned to avoid UB.
|
| |
|
|
|
|
|
|
| |
Should be '#ifdef HAVE_CONFIG_H'.
Closes: https://sourceforge.net/p/flac/bugs/410/
|
|
|
|
| |
Patch-from: lvqcl <lvqcl.mail@gmail.com>
|
| |
|
|
|
|
| |
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
|
| |
|
|
|
|
| |
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
|
|
|
|
|
|
|
| |
Add explicit extern to functions that are locally declared inline
but which also have non-inline public prototypes.
It seems MS VS does not quite meet the C99 spec (section 6.7.4).
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
- INCLUDES is deprecated, and CPPFLAGS is an user-defined
variable, use the proper AM_CPPFLAGS instead
- Remove FLAC__INLINE definition, providing proper
replacement for MSVC compilers.
- Detect if we have C99 's lround and provide a replacement
for windows...
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
https://sourceforge.net/tracker2/?func=detail&aid=1676822&group_id=13478&atid=113478)
|
| |
|
| |
|
|
|
|
| |
https://sourceforge.net/tracker/index.php?func=detail&aid=1684879&group_id=13478&atid=113478)
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|