Fix #10: Use of saturate function almost always causes a crash.

saturate: fix possible division by 0
SaturateImage: fix: had two 'image' members, one inherited, one nullptr, which caused a crash

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1458 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2010-07-22 00:29:35 +00:00
parent 55599011b4
commit 66bf7c8521
3 changed files with 31 additions and 37 deletions
-9
View File
@@ -228,9 +228,6 @@ Image EnlargeImage::generate(const Options& opt) const {
// done
return larger;
}
ImageCombine EnlargeImage::combine() const {
return image->combine();
}
bool EnlargeImage::operator == (const GeneratedImage& that) const {
const EnlargeImage* that2 = dynamic_cast<const EnlargeImage*>(&that);
return that2 && *image == *that2->image
@@ -242,9 +239,6 @@ bool EnlargeImage::operator == (const GeneratedImage& that) const {
Image CropImage::generate(const Options& opt) const {
return image->generate(opt).Size(wxSize((int)width, (int)height), wxPoint(-(int)offset_x, -(int)offset_y));
}
ImageCombine CropImage::combine() const {
return image->combine();
}
bool CropImage::operator == (const GeneratedImage& that) const {
const CropImage* that2 = dynamic_cast<const CropImage*>(&that);
return that2 && *image == *that2->image
@@ -340,9 +334,6 @@ Image DropShadowImage::generate(const Options& opt) const {
delete[] shadow;
return img;
}
ImageCombine DropShadowImage::combine() const {
return image->combine();
}
bool DropShadowImage::operator == (const GeneratedImage& that) const {
const DropShadowImage* that2 = dynamic_cast<const DropShadowImage*>(&that);
return that2 && *image == *that2->image