Win32 textdrawer: Fix rare crash affecting Patapon 2 in savedata manager. See 10764.

This commit is contained in:
Henrik Rydgård committed 2018-03-23 10:27:08 +01:00
1 parent 9849ceadc4
commit fb798cf6b2
3 files changed
+8 -5

No files matched your search

-3
View File
@@ -8,9 +8,6 @@
#include "base/logging.h"
#include "Common/Vulkan/VulkanLoader.h"
// Amount of time, in nanoseconds, to wait for a command buffer to complete
#define FENCE_TIMEOUT 10000000000
enum {
VULKAN_FLAG_VALIDATE = 1,
VULKAN_FLAG_PRESENT_MAILBOX = 2,
+2 -2
View File
@@ -186,7 +186,7 @@ bool DirectoryFileHandle::Open(std::string &basePath, std::string &fileName, Fil
#endif
std::string fullName = GetLocalPath(basePath,fileName);
DEBUG_LOG(FILESYS,"Actually opening %s", fullName.c_str());
VERBOSE_LOG(FILESYS,"Actually opening %s", fullName.c_str());
// On the PSP, truncating doesn't lose data. If you seek later, you'll recover it.
// This is abnormal, so we deviate from the PSP's behavior and truncate on write/close.
@@ -1002,7 +1002,7 @@ u32 VFSFileSystem::OpenFile(std::string filename, FileAccess access, const char
std::string fullName = GetLocalPath(filename);
const char *fullNameC = fullName.c_str();
DEBUG_LOG(FILESYS,"VFSFileSystem actually opening %s (%s)", fullNameC, filename.c_str());
VERBOSE_LOG(FILESYS,"VFSFileSystem actually opening %s (%s)", fullNameC, filename.c_str());
size_t size;
u8 *data = VFSReadFile(fullNameC, &size);
+6
View File
@@ -231,6 +231,12 @@ void TextDrawerWin32::DrawString(DrawBuffer &target, const char *str, float x, f
size.cx = MAX_TEXT_WIDTH;
if (size.cy > MAX_TEXT_HEIGHT)
size.cy = MAX_TEXT_HEIGHT;
// Prevent zero-sized textures, which can occur. Not worth to avoid
// creating the texture altogether in this case.
if (size.cx == 0)
size.cx = 1;
if (size.cy == 0)
size.cy = 1;
entry = new TextStringEntry();
entry->width = size.cx;