From: <sv...@op...> - 2025-06-09 16:48:14
|
Author: manx Date: Mon Jun 9 18:48:08 2025 New Revision: 23443 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=23443 Log: Merged revision(s) 23435 from trunk/OpenMPT: [Fix] openmpt123: Guard against libsndfile returning nullptr as file extension when matching the file format. ........ Modified: branches/OpenMPT-1.30/ (props changed) branches/OpenMPT-1.30/openmpt123/openmpt123_sndfile.hpp Modified: branches/OpenMPT-1.30/openmpt123/openmpt123_sndfile.hpp ============================================================================== --- branches/OpenMPT-1.30/openmpt123/openmpt123_sndfile.hpp Mon Jun 9 18:45:54 2025 (r23442) +++ branches/OpenMPT-1.30/openmpt123/openmpt123_sndfile.hpp Mon Jun 9 18:48:08 2025 (r23443) @@ -117,7 +117,7 @@ case match_recurse: break; case match_exact: - if ( extension == format_info.extension ) { + if ( format_info.extension && ( extension == format_info.extension ) ) { if ( flags.use_float && ( subformat_info.format == SF_FORMAT_FLOAT ) ) { return matched_result( format_info, subformat_info, match_mode ); } else if ( !flags.use_float && ( subformat_info.format == SF_FORMAT_PCM_16 ) ) { @@ -126,7 +126,7 @@ } break; case match_better: - if ( extension == format_info.extension ) { + if ( format_info.extension && ( extension == format_info.extension ) ) { if ( flags.use_float && ( subformat_info.format == SF_FORMAT_FLOAT || subformat_info.format == SF_FORMAT_DOUBLE ) ) { return matched_result( format_info, subformat_info, match_mode ); } else if ( !flags.use_float && ( subformat_info.format & ( subformat_info.format == SF_FORMAT_PCM_16 || subformat_info.format == SF_FORMAT_PCM_24 || subformat_info.format == SF_FORMAT_PCM_32 ) ) ) { @@ -135,7 +135,7 @@ } break; case match_any: - if ( extension == format_info.extension ) { + if ( format_info.extension && ( extension == format_info.extension ) ) { return matched_result( format_info, subformat_info, match_mode ); } break; |