Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SUGGESTIONS] BlitBackgroundEX and NULL Pointer : Ryan Ries #15

Open
yeokaiwei opened this issue Dec 10, 2022 · 0 comments
Open

[SUGGESTIONS] BlitBackgroundEX and NULL Pointer : Ryan Ries #15

yeokaiwei opened this issue Dec 10, 2022 · 0 comments

Comments

@yeokaiwei
Copy link

Hi Ryan,
Thanks for the tutorials.

I noticed an issue with void BlitBackground(In GAMEBITMAP GameBitmap, In int ColourAdjust)*

It is possible for GAMEBITMAP* to be a null pointer.

This will result in the game crashing during runtime and invoking watson.

Visual Studio cannot catch this.

Would adding a sanity check help?

**if (GameBitmap == NULL)
{
    LogMessagesA(LOGLEVEL_ERROR, "[%s] GameBitmap is NULL! Error 0x%08lx!", __FUNCTION__,GetLastError());

    exit(1);
}**

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant