From: Glenn Randers-Pehrson Date: Tue, 8 Aug 2017 13:10:26 +0000 (-0400) Subject: Refactored write_tIME_chunk X-Git-Tag: 7.0.6-6~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a47b35f3d687d6e949b20127de35f1113a6bb070;p=imagemagick Refactored write_tIME_chunk --- diff --git a/coders/png.c b/coders/png.c index 833dc6a94..ff7037759 100644 --- a/coders/png.c +++ b/coders/png.c @@ -8170,25 +8170,16 @@ static void write_tIME_chunk(Image *image,png_struct *ping,png_info *info, " Writing tIME chunk: timestamp property is %30s\n",timestamp); ret=sscanf(timestamp,"%d-%d-%dT%d:%d:%d",&year,&month,&day,&hour, &minute, &second); - if (ret < 6) - { - (void) ThrowMagickException(exception,GetMagickModule(),CoderError, - "Invalid date format specified for png:tIME","`%s'", - image->filename); - return; - } addhours=0; addminutes=0; ret=sscanf(timestamp,"%d-%d-%dT%d:%d:%d%d:%d",&year,&month,&day,&hour, &minute, &second, &addhours, &addminutes); if (ret < 6) { - LogMagickEvent(CoderEvent,GetMagickModule(), - " Invalid timestamp is %60s\n",timestamp); - (void) ThrowMagickException(exception,GetMagickModule(),CoderError, - "Invalid date format specified for png:tIME","`%s'", - image->filename); - return; + (void) ThrowMagickException(exception,GetMagickModule(),CoderError, + "Invalid date format specified for png:tIME","`%s'", + image->filename); + return; } ptime.year=(png_uint_16) year; ptime.month=(png_byte) month;