Skip to content

Commit

Permalink
PVS-Studio stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Kawa-oneechan committed Nov 9, 2023
1 parent 76e60a7 commit bd291c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
13 changes: 5 additions & 8 deletions SeqMaker/KawaTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,15 +192,12 @@ public void GetPixels(Bitmap from)
throw new FormatException("Input images can only be 320 by 200 pixels in size.");
}

if (palette != null)
for (var i = 0; i < victim.Palette.Entries.Length; i++)
{
for (var i = 0; i < victim.Palette.Entries.Length; i++)
{
var color = victim.Palette.Entries[i];
palette[i * 3 + 0] = color.R;
palette[i * 3 + 1] = color.G;
palette[i * 3 + 2] = color.B;
}
var color = victim.Palette.Entries[i];
palette[i * 3 + 0] = color.R;
palette[i * 3 + 1] = color.G;
palette[i * 3 + 2] = color.B;
}

var bitmapData = victim.LockBits(new Rectangle(0, 0, victim.Width, victim.Height), ImageLockMode.ReadOnly, victim.PixelFormat);
Expand Down
2 changes: 1 addition & 1 deletion SeqMaker/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ static int Main(string[] args)
var frameWidth = frameRight - frameLeft;
var frameHeight = frameBottom - frameTop;

if (frameHeight + frameWidth == 0)
if (frameHeight <=0 || frameWidth <= 0)
{
frameWidth = 1;
frameHeight = 1;
Expand Down

0 comments on commit bd291c6

Please sign in to comment.