Skip to content

Commit

Permalink
Cached image now catched allocation failure
Browse files Browse the repository at this point in the history
  • Loading branch information
Alastair Robinson committed May 29, 2010
1 parent a9c7212 commit ac689ab
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion imageutils/cachedimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ CachedImage_Deferred::CachedImage_Deferred(ImageSource *source)
Debug[TRACE] << "In CachedImage_Deferred constructor" << endl;
Debug[TRACE] << "Image type: " << type << ", width: " << width << ", height: " << height << endl;
Debug[TRACE] << "(" << source->type << ")" << endl;
imagedata=new ISDataType[width*height*samplesperpixel];
try
{
imagedata=new ISDataType[width*height*samplesperpixel];
}
catch (bad_alloc&)
{
throw "Can't allocate pixel buffer";
}
CMSProfile *prof=source->GetEmbeddedProfile();
if(prof)
embeddedprofile=new CMSProfile(*prof);
Expand Down

0 comments on commit ac689ab

Please sign in to comment.