avoid division by zero and fix segfault

Origin commit data
------------------
Branch: ni/coolstream
Commit: 9f20b27890
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2016-05-23 (Mon, 23 May 2016)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2016-05-23 14:17:25 +02:00
parent 95848d32b2
commit 7764d30ea3
2 changed files with 3 additions and 3 deletions

View File

@@ -431,7 +431,7 @@ bool CCDraw::CheckFbData(const cc_fbdata_t& fbdata, const char* func, const int
//screen area save
fb_pixel_t* CCDraw::getScreen(int ax, int ay, int dx, int dy)
{
if (dx * dy == 0)
if (dx < 1 || dy < 1 || dx * dy == 0)
return NULL;
dprintf(DEBUG_INFO, "[CCDraw] INFO! [%s - %d], ax = %d, ay = %d, dx = %d, dy = %d\n", __func__, __LINE__, ax, ay, dx, dy);