mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Fix write problem with reduced size IDAT chunks
png_set_compression_buffer_size would result in a spurious debug assert if the compression buffer size was set to something other than a multiple of PNG_ROW_BUFFER_SIZE; the debug test failed to add the buffer 'start' Signed-off-by: John Bowler <jbowler@acm.org>
This commit is contained in:
parent
79378d49b3
commit
e393f19527
@ -2363,7 +2363,8 @@ png_write_IDAT(png_structrp png_ptr, int flush)
|
|||||||
else /* not end of list */
|
else /* not end of list */
|
||||||
debug((ps->s.zs.next_out < next->output ||
|
debug((ps->s.zs.next_out < next->output ||
|
||||||
ps->s.zs.next_out > next->output + sizeof next->output) &&
|
ps->s.zs.next_out > next->output + sizeof next->output) &&
|
||||||
(ps->s.overflow > 0 || ps->s.len >= sizeof next->output));
|
(ps->s.overflow > 0 ||
|
||||||
|
ps->s.start + ps->s.len >= sizeof next->output));
|
||||||
|
|
||||||
/* First, if this is the very first IDAT (PNG_HAVE_IDAT not set)
|
/* First, if this is the very first IDAT (PNG_HAVE_IDAT not set)
|
||||||
* optimize the CINFO field:
|
* optimize the CINFO field:
|
||||||
@ -2419,7 +2420,6 @@ png_write_IDAT(png_structrp png_ptr, int flush)
|
|||||||
written = len;
|
written = len;
|
||||||
png_write_chunk_data(png_ptr, next->output+start, written);
|
png_write_chunk_data(png_ptr, next->output+start, written);
|
||||||
ps->s.start = (unsigned int)/*SAFE*/(start + written);
|
ps->s.start = (unsigned int)/*SAFE*/(start + written);
|
||||||
UNTESTED
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 'written' bytes were written: */
|
/* 'written' bytes were written: */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user