decoder/{dsdiff,dsf,mpg123,wavpack}: avoid exceptions in scan methods
The scan methods must be "noexcept".
This commit is contained in:
@@ -581,7 +581,14 @@ static bool
|
||||
wavpack_scan_file(Path path_fs,
|
||||
const TagHandler &handler, void *handler_ctx) noexcept
|
||||
{
|
||||
auto *wpc = WavpackOpenInput(path_fs, OPEN_DSD_FLAG, 0);
|
||||
WavpackContext *wpc;
|
||||
|
||||
try {
|
||||
wpc = WavpackOpenInput(path_fs, OPEN_DSD_FLAG, 0);
|
||||
} catch (...) {
|
||||
return false;
|
||||
}
|
||||
|
||||
AtScopeExit(wpc) {
|
||||
WavpackCloseFile(wpc);
|
||||
};
|
||||
@@ -598,8 +605,15 @@ wavpack_scan_stream(InputStream &is,
|
||||
const TagHandler &handler, void *handler_ctx) noexcept
|
||||
{
|
||||
WavpackInput isp(nullptr, is);
|
||||
auto *wpc = WavpackOpenInput(&mpd_is_reader, &isp, nullptr,
|
||||
OPEN_DSD_FLAG, 0);
|
||||
|
||||
WavpackContext *wpc;
|
||||
try {
|
||||
wpc = WavpackOpenInput(&mpd_is_reader, &isp, nullptr,
|
||||
OPEN_DSD_FLAG, 0);
|
||||
} catch (...) {
|
||||
return false;
|
||||
}
|
||||
|
||||
AtScopeExit(wpc) {
|
||||
WavpackCloseFile(wpc);
|
||||
};
|
||||
|
Reference in New Issue
Block a user