瀏覽代碼

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
Ivan Savenko 5 月之前
父節點
當前提交
3aa2771e92
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      client/media/CVideoHandler.cpp
  2. 1 1
      client/windows/CSpellWindow.cpp

+ 1 - 1
client/media/CVideoHandler.cpp

@@ -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);
 }

+ 1 - 1
client/windows/CSpellWindow.cpp

@@ -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()