GIFTranslator: call new(std::nothrow) BBitmap again
... to prevent throwing a std::bad_alloc exception if there isn't
enough memory to allocate a new BBitmap.
This effectively reverts 116e78d4d4
Thanks Axel and AnEvilYak and sorry for the noise.
This commit is contained in:
@@ -167,7 +167,10 @@ GetBitmap(BPositionIO* in, BBitmap** out)
|
|||||||
header.dataSize = B_BENDIAN_TO_HOST_INT32(header.dataSize);
|
header.dataSize = B_BENDIAN_TO_HOST_INT32(header.dataSize);
|
||||||
|
|
||||||
// dump data from stream into a BBitmap
|
// dump data from stream into a BBitmap
|
||||||
*out = new BBitmap(header.bounds, header.colors);
|
*out = new(std::nothrow) BBitmap(header.bounds, header.colors);
|
||||||
|
if (*out == NULL)
|
||||||
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
if (!(*out)->IsValid()) {
|
if (!(*out)->IsValid()) {
|
||||||
delete *out;
|
delete *out;
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
|
|||||||
Reference in New Issue
Block a user