mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[devel] Fix png_get_current_row_number in the interlaced case.
This commit is contained in:
committed by
Glenn Randers-Pehrson
parent
9c69360e97
commit
5432c01ffd
13
pngtrans.c
13
pngtrans.c
@@ -703,11 +703,21 @@ png_get_user_transform_ptr(png_const_structp png_ptr)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PNG_USER_TRANSFORM_INFO_SUPPORTED
|
||||
png_uint_32 PNGAPI
|
||||
png_get_current_row_number(png_const_structp png_ptr)
|
||||
{
|
||||
/* This API returns the row in output, not the input row: */
|
||||
if (png_ptr != NULL)
|
||||
return png_ptr->row_number;
|
||||
{
|
||||
if (png_ptr->interlaced == PNG_INTERLACE_NONE)
|
||||
return png_ptr->row_number;
|
||||
else if (png_ptr->interlaced == PNG_INTERLACE_ADAM7)
|
||||
return PNG_ROW_FROM_PASS_ROW(png_ptr->row_number, png_ptr->pass);
|
||||
|
||||
/* Else something bad is happening: */
|
||||
}
|
||||
|
||||
return PNG_UINT_32_MAX; /* help the app not to fail silently */
|
||||
}
|
||||
|
||||
@@ -718,6 +728,7 @@ png_get_current_pass_number(png_const_structp png_ptr)
|
||||
return png_ptr->pass;
|
||||
return 8; /* invalid */
|
||||
}
|
||||
#endif /* PNG_USER_TRANSFORM_INFO_SUPPORTED */
|
||||
#endif /* PNG_READ_USER_TRANSFORM_SUPPORTED ||
|
||||
PNG_WRITE_USER_TRANSFORM_SUPPORTED */
|
||||
#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
|
||||
|
||||
Reference in New Issue
Block a user