Skip to content

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

Description

@yeokaiwei

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions