]> git.sesse.net Git - vlc/commitdiff
contrib: gme: don't skip negative (fixes #14088)
authorHannes Domani <ssbssa@yahoo.de>
Fri, 6 Mar 2015 13:43:45 +0000 (14:43 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 8 Mar 2015 14:19:07 +0000 (15:19 +0100)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
contrib/src/gme/rules.mak
contrib/src/gme/skip-underrun.patch [new file with mode: 0644]

index f051781ae2840a3264bda36538c2d6e3ce2cdd6f..c9335c212d1b2993865fa56eb20086f6866dc9ff 100644 (file)
@@ -14,6 +14,7 @@ game-music-emu: game-music-emu-$(GME_VERSION).tar.bz2 .sum-gme
        $(UNPACK)
        $(APPLY) $(SRC)/gme/gme-static.patch
        $(APPLY) $(SRC)/gme/gme-quotes.patch
+       $(APPLY) $(SRC)/gme/skip-underrun.patch
        $(MOVE)
 
 .gme: game-music-emu toolchain.cmake
diff --git a/contrib/src/gme/skip-underrun.patch b/contrib/src/gme/skip-underrun.patch
new file mode 100644 (file)
index 0000000..8d63680
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/gme/Fir_Resampler.cpp    2013-03-17 02:38:55.000000000 +0100
++++ b/gme/Fir_Resampler.cpp    2015-03-06 14:33:01.061577900 +0100
+@@ -188,6 +188,8 @@
+ {
+       int remain = write_pos - buf.begin();
+       int max_count = remain - width_ * stereo;
++      if ( max_count < 0 )
++              return 0;
+       if ( count > max_count )
+               count = max_count;
+