Check the bitmap is valid before accessing its height/width/depth
This commit is contained in:
parent
b12cdc6739
commit
4bbd313ecf
1 changed files with 6 additions and 0 deletions
|
|
@ -275,16 +275,22 @@ bool wxBitmap::Create(int width, int height, const wxDC& WXUNUSED(dc))
|
|||
|
||||
int wxBitmap::GetHeight() const
|
||||
{
|
||||
wxCHECK_MSG( IsOk(), -1, "invalid bitmap" );
|
||||
|
||||
return M_PIXDATA.height();
|
||||
}
|
||||
|
||||
int wxBitmap::GetWidth() const
|
||||
{
|
||||
wxCHECK_MSG( IsOk(), -1, "invalid bitmap" );
|
||||
|
||||
return M_PIXDATA.width();
|
||||
}
|
||||
|
||||
int wxBitmap::GetDepth() const
|
||||
{
|
||||
wxCHECK_MSG( IsOk(), -1, "invalid bitmap" );
|
||||
|
||||
return M_PIXDATA.depth();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue