[devel] Fixed incorrect test in new png_push_save_buffer() code.

This commit is contained in:
Glenn Randers-Pehrson
2010-02-07 19:49:07 -06:00
parent e3f3c4ea0b
commit c40df89cef
3 changed files with 24 additions and 14 deletions

View File

@@ -693,8 +693,10 @@ png_push_save_buffer(png_structp png_ptr)
png_size_t new_max;
png_bytep old_buffer;
if (png_ptr->save_buffer_size == PNG_SIZE_MAX)
png_error(png_ptr, "Overflow of save_buffer");
if (png_ptr->save_buffer_max == PNG_SIZE_MAX ||
(png_ptr->save_buffer_size > PNG_SIZE_MAX -
png_ptr->current_buffer_size))
png_error(png_ptr, "Overflow of save_buffer");
if (png_ptr->save_buffer_size > PNG_SIZE_MAX -
(png_ptr->current_buffer_size +