fixed a possible segfault in an out of mem condition. Fixed build for Haiku, since libpng.a and libz.a are not build for Haiku it seems. Is there a specific reason to link them statically? These are system libs after all.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12813 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2005-05-25 18:04:34 +00:00
parent ccf52fa4fe
commit 7c5f224338
2 changed files with 12 additions and 2 deletions

View File

@ -17,7 +17,13 @@ Translator PNGTranslator :
PNGTranslator.cpp
PNGView.cpp ;
LinkSharedOSLibs PNGTranslator : be translation libpng.a libz.a ;
if ( $(TARGET_PLATFORM) = haiku ) {
LinkSharedOSLibs PNGTranslator :
libbe.so libtranslation.so libpng.so libz.so ;
} else {
LinkSharedOSLibs PNGTranslator :
be translation libpng.a libz.a ;
}
Package haiku-translationkit-cvs :
PNGTranslator :

View File

@ -819,7 +819,7 @@ PNGTranslator::translate_from_bits_to_png(BPositionIO *inSource,
result = B_ERROR;
break;
}
png_set_write_fn(ppng, static_cast<void *>(outDestination),
pngcb_write_data, pngcb_flush_data);
@ -849,6 +849,10 @@ PNGTranslator::translate_from_bits_to_png(BPositionIO *inSource,
}
if (nalloc < height) {
result = B_NO_MEMORY;
// clear out rest of the pointers,
// so we don't call delete[] with invalid pointers
for (; nalloc < height; nalloc++)
prows[nalloc] = NULL;
break;
}
}