[Scummvm-git-logs] scummvm master -> 0802db2a4e209033799391176b1952e91c57546a
bluegr
noreply at scummvm.org
Thu Jan 6 17:39:08 UTC 2022
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
a110714141 GRAPHICS: Remove superfluous memset
faa16c9023 GRAPHICS: Fix UB when bytesPerPixel == 4
0802db2a4e GUI: Initialize language and platform even if unused
Commit: a110714141b1d2c4c83aa537350780d8414edb57
https://github.com/scummvm/scummvm/commit/a110714141b1d2c4c83aa537350780d8414edb57
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2022-01-06T19:39:05+02:00
Commit Message:
GRAPHICS: Remove superfluous memset
Surface::create already initialized memory to 0 and getPixels can be
nullptr if bitmap size is 0. In this case memset gets called with
nullptr which is undefined behaviour.
Changed paths:
graphics/fonts/ttf.cpp
diff --git a/graphics/fonts/ttf.cpp b/graphics/fonts/ttf.cpp
index ae9ed55c188..8a0279aa522 100644
--- a/graphics/fonts/ttf.cpp
+++ b/graphics/fonts/ttf.cpp
@@ -817,7 +817,6 @@ bool TTFFont::cacheGlyph(Glyph &glyph, uint32 chr) const {
}
uint8 *dst = (uint8 *)glyph.image.getPixels();
- memset(dst, 0, glyph.image.h * glyph.image.pitch);
switch (bitmap->pixel_mode) {
case FT_PIXEL_MODE_MONO:
Commit: faa16c9023bae8891b7007c1a024942eaacb9cb8
https://github.com/scummvm/scummvm/commit/faa16c9023bae8891b7007c1a024942eaacb9cb8
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2022-01-06T19:39:05+02:00
Commit Message:
GRAPHICS: Fix UB when bytesPerPixel == 4
It doesn't even work on x86(_64) as 1 is not shifted
Changed paths:
graphics/cursorman.cpp
diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp
index 67a0e1e9551..d9eff1bf4fc 100644
--- a/graphics/cursorman.cpp
+++ b/graphics/cursorman.cpp
@@ -248,7 +248,8 @@ CursorManager::Cursor::Cursor(const void *data, uint w, uint h, int hotspotX, in
else
_format = *format;
_size = w * h * _format.bytesPerPixel;
- _keycolor = keycolor & ((1 << (_format.bytesPerPixel << 3)) - 1);
+ const uint32 keycolor_mask = (((uint32) -1) >> (sizeof(uint32) * 8 - _format.bytesPerPixel * 8));
+ _keycolor = keycolor & keycolor_mask;
#else
_format = Graphics::PixelFormat::createFormatCLUT8();
_size = w * h;
Commit: 0802db2a4e209033799391176b1952e91c57546a
https://github.com/scummvm/scummvm/commit/0802db2a4e209033799391176b1952e91c57546a
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2022-01-06T19:39:05+02:00
Commit Message:
GUI: Initialize language and platform even if unused
Changed paths:
gui/widgets/grid.h
diff --git a/gui/widgets/grid.h b/gui/widgets/grid.h
index 49f228efa2a..a054f268e61 100644
--- a/gui/widgets/grid.h
+++ b/gui/widgets/grid.h
@@ -69,7 +69,8 @@ struct GridItemInfo {
thumbPath = Common::String::format("icons/%s-%s.png", engineid.c_str(), gameid.c_str());
}
- GridItemInfo(const Common::String &groupHeader, int groupID) : title(groupHeader), isHeader(true), entryID(groupID) {
+ GridItemInfo(const Common::String &groupHeader, int groupID) : title(groupHeader), isHeader(true),
+ entryID(groupID), language(Common::UNK_LANG), platform(Common::kPlatformUnknown) {
thumbPath = Common::String("");
}
};
More information about the Scummvm-git-logs
mailing list