This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via 0e5b7fc4ac8116f1037a244c21159e5fd86f114f (commit) via eb54a5c7b5cea2633200111f7fb63b2dcfbaaaa1 (commit) from 2671d7bde14699b65a50897b4c55d16bebe5ff4e (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/0e5b7fc4ac8116f1037a244c21159e5fd86f1...
commit 0e5b7fc4ac8116f1037a244c21159e5fd86f114f Author: Cyril Hrubis metan@ucw.cz Date: Wed Apr 24 21:59:18 2013 +0200
loaders: BMP: Fix leak.
The Load() function was missing fclose().
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/libs/loaders/GP_BMP.c b/libs/loaders/GP_BMP.c index cb7a61b..29ee503 100644 --- a/libs/loaders/GP_BMP.c +++ b/libs/loaders/GP_BMP.c @@ -607,7 +607,6 @@ GP_Context *GP_ReadBMP(FILE *f, GP_ProgressCallback *callback) err2: GP_ContextFree(context); err1: - fclose(f); errno = err; return NULL; } @@ -615,11 +614,15 @@ err1: GP_Context *GP_LoadBMP(const char *src_path, GP_ProgressCallback *callback) { FILE *f; + GP_Context *res;
if (GP_OpenBMP(src_path, &f, NULL, NULL, NULL)) return NULL;
- return GP_ReadBMP(f, callback); + res = GP_ReadBMP(f, callback); + fclose(f); + + return res; }
/*
http://repo.or.cz/w/gfxprim.git/commit/eb54a5c7b5cea2633200111f7fb63b2dcfbaa...
commit eb54a5c7b5cea2633200111f7fb63b2dcfbaaaa1 Author: Cyril Hrubis metan@ucw.cz Date: Wed Apr 24 21:57:26 2013 +0200
test: loaders: Add Write cases for BMP.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/tests/loaders/loaders_suite.c b/tests/loaders/loaders_suite.c index 1de4fef..8b378dd 100644 --- a/tests/loaders/loaders_suite.c +++ b/tests/loaders/loaders_suite.c @@ -63,6 +63,8 @@ static int save_img(enum fmt fmt, const GP_Context *img, const char *name) return GP_SavePNG(img, buf, NULL); case JPG: return GP_SaveJPG(img, buf, NULL); + case BMP: + return GP_SaveBMP(img, buf, NULL); default: tst_err("Trying to save %s image", strfmt(fmt)); exit(TST_UNTESTED); @@ -148,6 +150,16 @@ static int test_JPG_stress(void) return save_load(JPG, 2000, 2000); }
+static int test_BMP_Save_Load(void) +{ + return save_load(BMP, 100, 100); +} + +static int test_BMP_stress(void) +{ + return save_load(BMP, 2000, 2000); +} + static int load_enoent(enum fmt fmt) { GP_Context *img; @@ -689,12 +701,16 @@ const struct tst_suite tst_suite = { .flags = TST_TMPDIR | TST_CHECK_MALLOC}, {.name = "JPG Save Load", .tst_fn = test_JPG_Save_Load, .flags = TST_TMPDIR | TST_CHECK_MALLOC}, + {.name = "BMP Save Load", .tst_fn = test_BMP_Save_Load, + .flags = TST_TMPDIR | TST_CHECK_MALLOC}, /* Stress Save Load tests */ {.name = "PNG Stress", .tst_fn = test_PNG_stress, .flags = TST_TMPDIR | TST_CHECK_MALLOC}, {.name = "JPG Stress", .tst_fn = test_JPG_stress, .flags = TST_TMPDIR | TST_CHECK_MALLOC}, + {.name = "BMP Stress", .tst_fn = test_BMP_stress, + .flags = TST_TMPDIR | TST_CHECK_MALLOC},
/* BPM loader tests */ {.name = "BMP Load 1bpp 1x1",
-----------------------------------------------------------------------
Summary of changes: libs/loaders/GP_BMP.c | 7 +++++-- tests/loaders/loaders_suite.c | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.