mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-15 03:38:37 +00:00
Merge pull request #4923 from lioncash/master
Fix possible null ptr derefs in sceFont.cpp. Also fix typo in if statement comparison in sceNetAdhoc.cpp
This commit is contained in:
commit
80d73f3d93
@ -848,9 +848,9 @@ int sceFontGetCharImageRect(u32 fontHandle, u32 charCode, u32 charRectPtr) {
|
||||
|
||||
PGFCharInfo charInfo;
|
||||
LoadedFont *font = GetLoadedFont(fontHandle, false);
|
||||
auto fontLib = font->GetFontLib();
|
||||
int altCharCode = fontLib == NULL ? -1 : fontLib->GetAltCharCode();
|
||||
if (font) {
|
||||
auto fontLib = font->GetFontLib();
|
||||
int altCharCode = fontLib == NULL ? -1 : fontLib->GetAltCharCode();
|
||||
font->GetPGF()->GetCharInfo(charCode, &charInfo, altCharCode);
|
||||
Memory::Write_U16(charInfo.bitmapWidth, charRectPtr); // character bitmap width in pixels
|
||||
Memory::Write_U16(charInfo.bitmapHeight, charRectPtr + 2); // character bitmap height in pixels
|
||||
|
@ -642,15 +642,15 @@ int sceNetAdhocPdpDelete(int id, int unknown) {
|
||||
SceNetAdhocPdpStat * sock = pdp[id - 1];
|
||||
|
||||
// Valid Socket
|
||||
if (socket != NULL) {
|
||||
if (sock != NULL) {
|
||||
// Close Connection
|
||||
closesocket(sock->id);
|
||||
|
||||
// Remove Port Forward from Router
|
||||
//sceNetPortClose("UDP", socket->lport);
|
||||
//sceNetPortClose("UDP", sock->lport);
|
||||
|
||||
// Free Memory
|
||||
// free(socket);
|
||||
// free(sock);
|
||||
|
||||
// Free Translation Slot
|
||||
pdp[id - 1] = NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user