mirror of
https://review.haiku-os.org/haiku
synced 2025-02-23 05:58:31 +01:00
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:
parent
ccf52fa4fe
commit
7c5f224338
@ -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 :
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user