From: Glenn Randers-Pehrson Date: Fri, 4 Aug 2017 02:32:19 +0000 (-0400) Subject: handle short months in PNG tIME chunk generation X-Git-Tag: 7.0.6-6~30 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=69be5e3f08698f9d48d943f2ed48e70b79dde533;p=imagemagick handle short months in PNG tIME chunk generation --- diff --git a/coders/png.c b/coders/png.c index 0a5a60455..150e0f0aa 100644 --- a/coders/png.c +++ b/coders/png.c @@ -8193,8 +8193,10 @@ static void write_tIME_chunk(Image *image,png_struct *ping,png_info *info, { ptime.hour = 0; ptime.day ++; - /* To do: fix this for short months */ - if (ptime.day > 31) + /* To do: fix this for leap years */ + if (ptime.day > 31 || (ptime.month == 2 && ptime.day > 28) || + ((ptime.month == 4 || ptime.month == 6 || ptime.month == 9 || + ptime.month == 11) && ptime.day > 30)) { ptime.day = 1; ptime.month++;