1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-28 05:29:48 +00:00

Fix an arithmetic overflow in the RICE2 partitioner.

For a specific 24 bit WAV file encoding with compression level 7
was generating a file a couple of orders of magnitude larger than
the original.

Obtained from:	upstream
This commit is contained in:
Christian Weisgerber 2013-07-18 17:47:53 +00:00
parent 4cedf92c26
commit cc726fac0d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=323248
2 changed files with 15 additions and 1 deletions

View File

@ -3,6 +3,7 @@
PORTNAME= flac
PORTVERSION= 1.3.0
PORTREVISION= 1
CATEGORIES= audio
MASTER_SITES= http://downloads.xiph.org/releases/flac/
@ -20,7 +21,6 @@ CONFIGURE_ARGS= --enable-sse \
--disable-silent-rules \
--disable-thorough-tests \
--disable-xmms-plugin
MAKE_JOBS_SAFE= yes
OPTIONS_DEFINE= DOCS ICONV
OPTIONS_DEFAULT=ICONV

View File

@ -0,0 +1,14 @@
$FreeBSD$
--- src/libFLAC/stream_encoder.c.orig
+++ src/libFLAC/stream_encoder.c
@@ -3784,7 +3784,7 @@
/* slightly pessimistic but still catches all common cases */
/* WATCHOUT: "+ bps" is an assumption that the average residual magnitude will not be more than "bps" bits */
if(FLAC__bitmath_ilog2(default_partition_samples) + bps < 32) {
- FLAC__uint32 abs_residual_partition_sum;
+ FLAC__uint64 abs_residual_partition_sum;
for(partition = residual_sample = 0; partition < partitions; partition++) {
end += default_partition_samples;