From: Glenn Randers-Pehrson Date: Sun, 20 Aug 2017 19:48:19 +0000 (-0400) Subject: Handle short months in png_write_iTIME() X-Git-Tag: 7.0.7-0~89 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb2fa6132bc93a2b75a07d6bc915d89b83e83d0d;p=imagemagick Handle short months in png_write_iTIME() --- diff --git a/coders/png.c b/coders/png.c index 8eedbeaa8..3604ed570 100644 --- a/coders/png.c +++ b/coders/png.c @@ -8202,7 +8202,16 @@ static void write_tIME_chunk(Image *image,png_struct *ping,png_info *info, { /* wrong for short months */ ptime.month--; - ptime.day=31; + if(ptime.month == 2) + ptime.day=28; + else + { + if(ptime.month == 4 || ptime.month == 6 || ptime.month == 9 || + ptime.month == 11) + ptime.day=30; + else + ptime.day=31; + } } if (ptime.month == 0) {