From 8e855eec1373d9c6dacd1b506d91f6da784cc6aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Heusipp?= Date: Fri, 15 Mar 2024 20:43:31 +0000 Subject: [PATCH] Merged revision(s) 20367 from branches/OpenMPT-1.30: Merged revision(s) 20366 from branches/OpenMPT-1.31/libopenmpt/xmp-openmpt: Merged revision(s) 20365 from trunk/OpenMPT: [Fix] xmp-openmpt: Fix xmplay_streambuf::underflow(). When returning eof, we also need to set the get area to empty according to the standard. ........ ........ ........ git-svn-id: https://source.openmpt.org/svn/openmpt/branches/OpenMPT-1.28@20369 56274372-70c3-4bfc-bfc3-4c3a0b034d27 --- libopenmpt/xmp-openmpt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libopenmpt/xmp-openmpt.cpp b/libopenmpt/xmp-openmpt.cpp index 630f9b2145d..adbec65ff33 100644 --- a/libopenmpt/xmp-openmpt.cpp +++ b/libopenmpt/xmp-openmpt.cpp @@ -510,10 +510,10 @@ std::streambuf::int_type xmplay_streambuf::underflow() { start += put_back_count; } std::size_t n = xmpffile->Read( file, start, buffer.size() - ( start - base ) ); + setg( base, start, start + n ); if ( n == 0 ) { return traits_type::eof(); } - setg( base, start, start + n ); return traits_type::to_int_type( *gptr() ); }