Skip to content

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

@yeokaiwei

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.

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