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

Hannes Domani git at videolan.org
Sun Mar 8 22:26:22 CET 2015


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

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

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit e11d1337c0997bea2c6d256845012b47044bf88a)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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