[Scummvm-git-logs] scummvm master -> dcf3bf3a1dac1c52c7c8bd108849244fd3091b41
digitall
noreply at scummvm.org
Mon Sep 4 13:33:29 UTC 2023
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
dcf3bf3a1d GRAPHICS: Fix GCC Compiler Warnings on Realloc Usage in Freetype Interface
Commit: dcf3bf3a1dac1c52c7c8bd108849244fd3091b41
https://github.com/scummvm/scummvm/commit/dcf3bf3a1dac1c52c7c8bd108849244fd3091b41
Author: D G Turner (digitall at scummvm.org)
Date: 2023-09-04T14:31:34+01:00
Commit Message:
GRAPHICS: Fix GCC Compiler Warnings on Realloc Usage in Freetype Interface
Calling realloc() with a size of 0 is implementation dependent and thus
should be avoided for portability.
Changed paths:
graphics/fonts/freetype.cpp
diff --git a/graphics/fonts/freetype.cpp b/graphics/fonts/freetype.cpp
index 755751c2ac2..67a91ec0fd8 100644
--- a/graphics/fonts/freetype.cpp
+++ b/graphics/fonts/freetype.cpp
@@ -36,11 +36,12 @@ namespace Graphics {
namespace FreeType {
void *Alloc_Callback(FT_Memory memory, long size) {
- return realloc(nullptr, static_cast<size_t>(size));
+ return malloc(static_cast<size_t>(size));
}
void Free_Callback(FT_Memory memory, void *block) {
- realloc(block, 0);
+ free(block);
+ block = nullptr;
}
void *Realloc_Callback(FT_Memory memory, long cur_size, long new_size, void *block) {
More information about the Scummvm-git-logs
mailing list