提交 7f576964 编写于 作者: J John Bowler

pngunknown.c: handle unknown IDAT

This is the test backported from 1.7 to ensure that when treating IDATs as
unknown the test does not fail if there are more than one IDAT chunks in the
file.
Signed-off-by: NJohn Bowler <jbowler@acm.org>
上级 0873ae82
......@@ -1002,6 +1002,20 @@ perform_one_test(FILE *fp, int argc, const char **argv,
def = check(fp, argc, argv, flags[1], d, set_callback);
/* If IDAT is being handled as unknown the image read is skipped and all the
* IDATs after the first end up in the end info struct, so in this case add
* IDAT to the list of unknowns. (Do this after 'check' above sets the
* chunk_info 'keep' fields.)
*
* Note that the flag setting has to be in the 'known' field to avoid
* triggeriing the consistency check below and the flag must only be set if
* there are multiple IDATs, so if the check above did find an unknown IDAT
* after IDAT.
*/
if (chunk_info[0/*IDAT*/].keep != PNG_HANDLE_CHUNK_AS_DEFAULT &&
(flags[1][3] & PNG_INFO_IDAT) != 0)
flags[0][2] |= PNG_INFO_IDAT;
/* Chunks should either be known or unknown, never both and this should apply
* whether the chunk is before or after the IDAT (actually, the app can
* probably change this by swapping the handling after the image, but this
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册