diff options
author | naddy <naddy@FreeBSD.org> | 2013-07-19 01:47:53 +0800 |
---|---|---|
committer | naddy <naddy@FreeBSD.org> | 2013-07-19 01:47:53 +0800 |
commit | 6c7c4885960e86cdd964d50be14f5cca8cb08af5 (patch) | |
tree | 28a912a53ca96562d880a20613e2e08e5d9eee0d /audio | |
parent | 58147c2c7563431bfca4669c44b7f5fa3e1d9602 (diff) | |
download | freebsd-ports-gnome-6c7c4885960e86cdd964d50be14f5cca8cb08af5.tar.gz freebsd-ports-gnome-6c7c4885960e86cdd964d50be14f5cca8cb08af5.tar.zst freebsd-ports-gnome-6c7c4885960e86cdd964d50be14f5cca8cb08af5.zip |
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
Diffstat (limited to 'audio')
-rw-r--r-- | audio/flac/Makefile | 2 | ||||
-rw-r--r-- | audio/flac/files/patch-src_libFLAC_stream__encoder.c | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/audio/flac/Makefile b/audio/flac/Makefile index f2a5e1a6621f..ad6e5ae8701b 100644 --- a/audio/flac/Makefile +++ b/audio/flac/Makefile @@ -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 diff --git a/audio/flac/files/patch-src_libFLAC_stream__encoder.c b/audio/flac/files/patch-src_libFLAC_stream__encoder.c new file mode 100644 index 000000000000..4392b9b0fa5a --- /dev/null +++ b/audio/flac/files/patch-src_libFLAC_stream__encoder.c @@ -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; |