1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-10 22:31:40 +02:00

Fix crash on playing spellbook pageflip video

Was reported on Discord.
- Fixes corrupted name of spellbook page flip video
- Fixes possible crash on deleting invalid video instance
This commit is contained in:
Ivan Savenko
2025-05-15 17:55:17 +03:00
parent ce77914b7e
commit 3aa2771e92
2 changed files with 2 additions and 2 deletions

View File

@@ -376,7 +376,7 @@ FFMpegStream::~FFMpegStream()
// for some reason, buffer is managed (e.g. reallocated) by FFmpeg
// however, it must still be freed manually by user
if (context->buffer)
if (context && context->buffer)
av_free(context->buffer);
av_free(context);
}

View File

@@ -520,7 +520,7 @@ void CSpellWindow::turnPageRight()
{
OBJECT_CONSTRUCTION;
if(settings["video"]["spellbookAnimation"].Bool() && !isBigSpellbook)
video = std::make_shared<VideoWidgetOnce>(Point(13, 14), VideoPath::builtin("PGTRNRENGINE->SMK"), false, this);
video = std::make_shared<VideoWidgetOnce>(Point(13, 14), VideoPath::builtin("PGTRNRGH.SMK"), false, this);
}
void CSpellWindow::onVideoPlaybackFinished()