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:
@@ -17,7 +17,13 @@ Translator PNGTranslator :
|
|||||||
PNGTranslator.cpp
|
PNGTranslator.cpp
|
||||||
PNGView.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 :
|
Package haiku-translationkit-cvs :
|
||||||
PNGTranslator :
|
PNGTranslator :
|
||||||
|
|||||||
@@ -819,7 +819,7 @@ PNGTranslator::translate_from_bits_to_png(BPositionIO *inSource,
|
|||||||
result = B_ERROR;
|
result = B_ERROR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
png_set_write_fn(ppng, static_cast<void *>(outDestination),
|
png_set_write_fn(ppng, static_cast<void *>(outDestination),
|
||||||
pngcb_write_data, pngcb_flush_data);
|
pngcb_write_data, pngcb_flush_data);
|
||||||
|
|
||||||
@@ -849,6 +849,10 @@ PNGTranslator::translate_from_bits_to_png(BPositionIO *inSource,
|
|||||||
}
|
}
|
||||||
if (nalloc < height) {
|
if (nalloc < height) {
|
||||||
result = B_NO_MEMORY;
|
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user