summaryrefslogtreecommitdiff
path: root/src/resources/dyepalette.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-24 18:41:42 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-25 22:08:24 +0300
commitd49a520d19f28c613c68b574686b182a9c0621be (patch)
tree5b6943125fd364eaaaaa295b45100cdfc473dd93 /src/resources/dyepalette.cpp
parent14f55eb8c6e44763e70046b9661bd056280226a5 (diff)
downloadplus-d49a520d19f28c613c68b574686b182a9c0621be.tar.gz
plus-d49a520d19f28c613c68b574686b182a9c0621be.tar.bz2
plus-d49a520d19f28c613c68b574686b182a9c0621be.tar.xz
plus-d49a520d19f28c613c68b574686b182a9c0621be.zip
Add missing checks into resources directory.
Diffstat (limited to 'src/resources/dyepalette.cpp')
-rw-r--r--src/resources/dyepalette.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/resources/dyepalette.cpp b/src/resources/dyepalette.cpp
index 44049997a..895f9c03f 100644
--- a/src/resources/dyepalette.cpp
+++ b/src/resources/dyepalette.cpp
@@ -100,7 +100,7 @@ unsigned int DyePalette::hexDecode(const signed char c)
}
void DyePalette::getColor(const unsigned int intensity,
- unsigned int color[3]) const
+ unsigned int (&color)[3]) const
{
if (intensity == 0)
{
@@ -152,7 +152,7 @@ void DyePalette::getColor(const unsigned int intensity,
color[2] = ((255 - t) * b1 + t * b2) / 255;
}
-void DyePalette::getColor(double intensity, int color[3]) const
+void DyePalette::getColor(double intensity, int (&color)[3]) const
{
// Nothing to do here
if (mColors.empty())
@@ -202,7 +202,7 @@ void DyePalette::replaceSColor(uint32_t *restrict pixels,
{
std::vector<DyeColor>::const_iterator it_end = mColors.end();
const size_t sz = mColors.size();
- if (!sz)
+ if (!sz || !pixels)
return;
if (sz % 2)
-- it_end;
@@ -310,7 +310,7 @@ void DyePalette::replaceAColor(uint32_t *restrict pixels,
{
std::vector<DyeColor>::const_iterator it_end = mColors.end();
const size_t sz = mColors.size();
- if (!sz)
+ if (!sz || !pixels)
return;
if (sz % 2)
-- it_end;
@@ -401,7 +401,7 @@ void DyePalette::replaceSOGLColor(uint32_t *restrict pixels,
{
std::vector<DyeColor>::const_iterator it_end = mColors.end();
const size_t sz = mColors.size();
- if (!sz)
+ if (!sz || !pixels)
return;
if (sz % 2)
-- it_end;
@@ -496,7 +496,7 @@ void DyePalette::replaceAOGLColor(uint32_t *restrict pixels,
{
std::vector<DyeColor>::const_iterator it_end = mColors.end();
const size_t sz = mColors.size();
- if (!sz)
+ if (!sz || !pixels)
return;
if (sz % 2)
-- it_end;