lame/lame-int_resample_ratio.patch
Ismail Dönmez d82ffd35d1 - Add patch for SSE
- Add check for invalid input sample rate
- Avoid malformed wav causing floating point exception (integer divide by zero) 
- Fix warning on 64 bit machines. Explicitely set variables as unsigned ints.
- Enable functions with SSE instructions to maintain their own properly aligned stack
- Fix decision if sample rate ratio is an integer value or not
- run autoreconf, set GTK_CFLAGS
- Add patch to remove ansi2knr instead of using sed

- Redux the conditionals for not building gtk1 anywhere anymore

- Fix logical issue in hvogel's fix 

- Fix the conditional building of gtk1 binaries 

- Fix pkgconfig(gtk+-2.0) for >= 11.4 

- Fix bug reporting link
- BuildRequires nasm only in x86-32 (there is no assembly available
  for other archs)
- Stop BuildRequiring flac-devel, it's not used
- Remove autoreconf call and related BuildRequires and patches
- Remove old compatibility Provides
- Run spec-cleaner
- Removed all patches (unneeded)
- Replace some documentation and let the build system install its
  own

- update to 3.99.5: fixed build on 12.2

OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/lame?expand=0&rev=1
2017-02-22 09:40:08 +00:00

30 lines
1.0 KiB
Diff

Subject: Fix decision if sample rate ratio is an integer value or not
If the sample rate of the input file is sufficiently close to an
integer multiple of the output sample rate, the value of the intratio
variable is calculated incorrectly. This leads to further values
being miscalculated up to the joff variable which is used as an index
to dereference the esv->blackfilt array. This leads top an overflow
and causes a segmentation fault.
Author: Fabian Greffrath <fabian+debian@greffrath.com>
Bug-Debian: https://bugs.debian.org/778529
--- a/libmp3lame/util.c
+++ b/libmp3lame/util.c
@@ -26,6 +26,7 @@
# include <config.h>
#endif
+#include <float.h>
#include "lame.h"
#include "machine.h"
#include "encoder.h"
@@ -544,7 +545,7 @@ fill_buffer_resample(lame_internal_flags
if (bpc > BPC)
bpc = BPC;
- intratio = (fabs(resample_ratio - floor(.5 + resample_ratio)) < .0001);
+ intratio = (fabs(resample_ratio - floor(.5 + resample_ratio)) < FLT_EPSILON);
fcn = 1.00 / resample_ratio;
if (fcn > 1.00)
fcn = 1.00;