From: <sv...@op...> - 2024-03-15 20:40:53
|
Author: manx Date: Fri Mar 15 21:40:36 2024 New Revision: 20365 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20365 Log: [Fix] xmp-openmpt: Fix xmplay_streambuf::underflow(). When returning eof, we also need to set the get area to empty according to the standard. Modified: trunk/OpenMPT/libopenmpt/xmp-openmpt/xmp-openmpt.cpp Modified: trunk/OpenMPT/libopenmpt/xmp-openmpt/xmp-openmpt.cpp ============================================================================== --- trunk/OpenMPT/libopenmpt/xmp-openmpt/xmp-openmpt.cpp Fri Mar 15 18:40:00 2024 (r20364) +++ trunk/OpenMPT/libopenmpt/xmp-openmpt/xmp-openmpt.cpp Fri Mar 15 21:40:36 2024 (r20365) @@ -537,10 +537,10 @@ 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() ); } |