From: Changyeon Lee Date: Thu, 12 Dec 2019 04:25:25 +0000 (+0900) Subject: tdm_helper: set up error handling when dump png X-Git-Tag: submit/tizen_5.5/20191212.050355~1 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Flibtdm.git;a=commitdiff_plain;h=1b7598d79bf9bcceeac1ee83a201d58c0845cff0 tdm_helper: set up error handling when dump png Change-Id: I018629b23532fd47b06ba3a37f618b447034aad4 --- diff --git a/src/tdm_helper.c b/src/tdm_helper.c index 804a112..08477f1 100644 --- a/src/tdm_helper.c +++ b/src/tdm_helper.c @@ -136,6 +136,13 @@ _tdm_helper_dump_png(const char *file, const void *data, int width, return; } + if (setjmp(png_jmpbuf(pPngStruct))) { + /* if png has problem of writing the file, we get here */ + png_destroy_write_struct(&pPngStruct, &pPngInfo); + fclose(fp); + return; + } + png_init_io(pPngStruct, fp); png_set_IHDR(pPngStruct, pPngInfo,