[libpng16] Fix Coverity defect regarding errmsg in pngrutil.c

This commit is contained in:
Glenn Randers-Pehrson 2017-09-23 21:22:18 -05:00
parent 073fe76f6a
commit 3d2d0b52a3

View File

@ -1584,17 +1584,11 @@ png_handle_iCCP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
return; return;
} }
} }
if (errmsg == NULL)
errmsg = "truncated";
#ifndef __COVERITY__
if (size == 0)
errmsg = png_ptr->zstream.msg; errmsg = png_ptr->zstream.msg;
#endif
} }
/* else png_icc_check_tag_table output an error */ /* else png_icc_check_tag_table output an error */
} }
else /* profile truncated */ else /* profile truncated */
errmsg = png_ptr->zstream.msg; errmsg = png_ptr->zstream.msg;
} }