[vlc-commits] contrib: gme: don't skip negative (fixes #14088)

Hannes Domani git at videolan.org
Sun Mar 8 15:19:19 CET 2015


vlc | branch: master | Hannes Domani <ssbssa at yahoo.de> | Fri Mar  6 14:43:45 2015 +0100| [e11d1337c0997bea2c6d256845012b47044bf88a] | committer: Jean-Baptiste Kempf

contrib: gme: don't skip negative (fixes #14088)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e11d1337c0997bea2c6d256845012b47044bf88a
---

 contrib/src/gme/rules.mak           |    1 +
 contrib/src/gme/skip-underrun.patch |   11 +++++++++++
 2 files changed, 12 insertions(+)

diff --git a/contrib/src/gme/rules.mak b/contrib/src/gme/rules.mak
index f051781..c9335c2 100644
--- a/contrib/src/gme/rules.mak
+++ b/contrib/src/gme/rules.mak
@@ -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
index 0000000..8d63680
--- /dev/null
+++ b/contrib/src/gme/skip-underrun.patch
@@ -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;
+ 	



More information about the vlc-commits mailing list