simplified this weird code, while also fixing CID 1059

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27528 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2008-09-15 13:02:39 +00:00
parent b4ec7b8ee5
commit 7bc02c61bd
@@ -186,20 +186,18 @@ Translate(BPositionIO *inSource, const translator_info *inInfo,
bigtime_t now = system_time(); bigtime_t now = system_time();
// Going from BBitmap to GIF // Going from BBitmap to GIF
if (!is_gif) { if (!is_gif) {
BBitmap **b = (BBitmap **)malloc(4); BBitmap *bitmap = NULL;
*b = NULL; err = GetBitmap(inSource, &bitmap);
err = GetBitmap(inSource, b); if (err != B_OK)
if (err != B_OK) return err; return err;
GIFSave *gs = new GIFSave(*b, outDestination); GIFSave *gs = new GIFSave(bitmap, outDestination);
if (gs->fatalerror) { if (gs->fatalerror) {
delete gs; delete gs;
if (*b != NULL) delete *b; delete bitmap;
delete b;
return B_NO_MEMORY; return B_NO_MEMORY;
} }
delete gs; delete gs;
delete *b; delete bitmap;
delete b;
} else { // GIF to BBitmap } else { // GIF to BBitmap
GIFLoad *gl = new GIFLoad(inSource, outDestination); GIFLoad *gl = new GIFLoad(inSource, outDestination);
if (gl->fatalerror) { if (gl->fatalerror) {