mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-16 14:50:17 +00:00
DIRECTOR: Simplify opening stream Cast::loadConfig
Remove check if resource exists in the stream when loading a cast. This check is already executed by `Archive::getMovieResourceIfPresent`. Coverity found this as a Deference null return value due to not checking if the stream was not a nullptr. Fixes COVERITY: 1491676
This commit is contained in:
parent
3520f7a26f
commit
2c466952d9
@ -229,15 +229,13 @@ void Cast::loadArchive() {
|
||||
}
|
||||
|
||||
bool Cast::loadConfig() {
|
||||
if (!_castArchive->hasResource(MKTAG('V', 'W', 'C', 'F'), -1)) {
|
||||
Common::SeekableReadStreamEndian *stream = nullptr;
|
||||
stream = _castArchive->getMovieResourceIfPresent(MKTAG('V', 'W', 'C', 'F'));
|
||||
if (!stream) {
|
||||
warning("Cast::loadConfig(): Wrong format. VWCF resource missing");
|
||||
return false;
|
||||
}
|
||||
|
||||
Common::SeekableReadStreamEndian *stream = nullptr;
|
||||
|
||||
stream = _castArchive->getMovieResourceIfPresent(MKTAG('V', 'W', 'C', 'F'));
|
||||
|
||||
debugC(1, kDebugLoading, "****** Loading Config VWCF");
|
||||
|
||||
if (debugChannelSet(5, kDebugLoading))
|
||||
|
Loading…
Reference in New Issue
Block a user