Skip to content

Commit

Permalink
fix(zscript): sanity check for bitmap->isValid() and bitmap->isAlloca…
Browse files Browse the repository at this point in the history
…ted()
  • Loading branch information
Moosh64 committed Jan 16, 2024
1 parent 377981e commit c07f28f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/zc/ffscript.cpp
Expand Up @@ -41585,7 +41585,7 @@ void FFScript::do_isvalidbitmap()
int32_t UID = get_register(sarg1);
//zprint("isValidBitmap() bitmap pointer value is %d\n", UID);
if ( UID <= 0 ) set_register(sarg1, 0);
else if ( scb.script_created_bitmaps[UID-10].u_bmp )
else if ( UID-10>=0 && UID-10 < 256 && scb.script_created_bitmaps[UID-10].u_bmp )
set_register(sarg1, 10000);
else set_register(sarg1, 0);
}
Expand All @@ -41596,7 +41596,7 @@ void FFScript::do_isallocatedbitmap()
if ( UID <= 0 ) set_register(sarg1, 0);
else
{
set_register(sarg1, (scb.script_created_bitmaps[UID-10].reserved()) ? 10000L : 0L);
set_register(sarg1, (UID-10>=0 && UID-10 < 256 && scb.script_created_bitmaps[UID-10].reserved()) ? 10000L : 0L);
/*
UID-=10;
if ( UID <= highest_valid_user_bitmap() || UID < firstUserGeneratedBitmap)
Expand Down

0 comments on commit c07f28f

Please sign in to comment.