mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Prototype implementation of filter selection
This rewrites the code used previously in the heuristics to make it easier to debug and introduces the 'methodical' method, which is intended to be an expensive but reliable way of reducing image size. The code in this commit does not work; the 'methodical' test for success does not take account of data buffered inside zlib and, anyway, it changes the results of pngtest so that the test fails. This commit is just a checkpoint of the current state; another commit will temporarily disable the 'methodical' code. Signed-off-by: John Bowler <jbowler@acm.org>
This commit is contained in:
8
pngmem.c
8
pngmem.c
@@ -87,13 +87,17 @@ png_malloc_base,(png_const_structrp png_ptr, png_alloc_size_t size),
|
||||
if (size > 0 && size <= PNG_SIZE_MAX)
|
||||
#endif
|
||||
{
|
||||
png_voidp result;
|
||||
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
if (png_ptr != NULL && png_ptr->malloc_fn != NULL)
|
||||
return png_ptr->malloc_fn(png_constcast(png_structrp,png_ptr), size);
|
||||
result = png_ptr->malloc_fn(png_constcast(png_structrp,png_ptr), size);
|
||||
|
||||
else
|
||||
#endif
|
||||
return malloc((size_t)size); /* checked for truncation above */
|
||||
result = malloc((size_t)size); /* checked for truncation above */
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user