[vlc-commits] [Git][videolan/vlc][master] contrib: gme: backport AY_emu read buffer overflow
Steve Lhomme (@robUx4)
gitlab at videolan.org
Sat Aug 29 18:44:51 UTC 2026
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
cb00196e by Steve Lhomme at 2026-08-29T17:59:36+00:00
contrib: gme: backport AY_emu read buffer overflow
Until there's a release with that fix.
Fixes #29895
- - - - -
2 changed files:
- + contrib/src/gme/ae10a8f05479e3c8f80429e7a59759fed06f8c13.patch
- contrib/src/gme/rules.mak
Changes:
=====================================
contrib/src/gme/ae10a8f05479e3c8f80429e7a59759fed06f8c13.patch
=====================================
@@ -0,0 +1,25 @@
+From ae10a8f05479e3c8f80429e7a59759fed06f8c13 Mon Sep 17 00:00:00 2001
+From: Wohlstand <admin at wohlnet.ru>
+Date: Sat, 4 Jul 2026 15:56:19 +0300
+Subject: [PATCH] Ay_Emu.cpp: Don't read farther than buffer allows
+
+Even at release builds!
+---
+ gme/Ay_Emu.cpp | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/gme/Ay_Emu.cpp b/gme/Ay_Emu.cpp
+index e99b6fdc..af290fbc 100644
+--- a/gme/Ay_Emu.cpp
++++ b/gme/Ay_Emu.cpp
+@@ -54,7 +54,9 @@ static byte const* get_data( Ay_Emu::file_t const& file, byte const* ptr, int mi
+ {
+ long pos = ptr - (byte const*) file.header;
+ long file_size = file.end - (byte const*) file.header;
+- assert( (unsigned long) pos <= (unsigned long) file_size - 2 );
++ // assert( (unsigned long) pos <= (unsigned long) file_size - 2 );
++ if ( (unsigned long) pos > (unsigned long) file_size - 2 )
++ return 0; // Don't read farther than buffer allows
+ int offset = (int16_t) get_be16( ptr );
+ if ( !offset || uint32_t (pos + offset) > uint32_t (file_size - min_size) )
+ return 0;
=====================================
contrib/src/gme/rules.mak
=====================================
@@ -14,6 +14,7 @@ DEPS_gme = zlib $(DEPS_zlib)
game-music-emu: game-music-emu-$(GME_VERSION).tar.gz .sum-gme
$(UNPACK)
+ $(APPLY) $(SRC)/gme/ae10a8f05479e3c8f80429e7a59759fed06f8c13.patch
$(call pkg_static,"gme/libgme.pc.in")
$(MOVE)
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/cb00196e1d88781dc13f785f38efaab0bde4c9ae
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/cb00196e1d88781dc13f785f38efaab0bde4c9ae
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
More information about the vlc-commits
mailing list