summaryrefslogtreecommitdiff
path: root/src/lib/emile
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2015-04-25 20:00:44 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-04-25 20:00:44 +0200
commiteaf9822094ac02631216ab0b79849392034b9f8f (patch)
tree4c934f9efd6ef933e2fdcfbbf153b2bfc86f90d7 /src/lib/emile
parentd22155487b21d6910813ad0aa0d12b86fb7051b8 (diff)
emile: fix memory leak.
CID 1288918 & 1288919
Diffstat (limited to 'src/lib/emile')
-rw-r--r--src/lib/emile/emile_image.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/emile/emile_image.c b/src/lib/emile/emile_image.c
index 06a5da4e88..d0f35a16b3 100644
--- a/src/lib/emile/emile_image.c
+++ b/src/lib/emile/emile_image.c
@@ -519,13 +519,19 @@ _emile_tgv_data(Emile_Image *image,
519 if (image->compress) 519 if (image->compress)
520 { 520 {
521 if (!emile_expand(data_start, buffer, EMILE_LZ4HC)) 521 if (!emile_expand(data_start, buffer, EMILE_LZ4HC))
522 goto on_error; 522 {
523 eina_binbuf_free(data_start);
524 goto on_error;
525 }
523 } 526 }
524 else 527 else
525 { 528 {
526 buffer = data_start; 529 buffer = data_start;
527 if (block_count * etc_block_size != block_length) 530 if (block_count * etc_block_size != block_length)
528 goto on_error; 531 {
532 eina_binbuf_free(data_start);
533 goto on_error;
534 }
529 } 535 }
530 it = eina_binbuf_string_get(buffer); 536 it = eina_binbuf_string_get(buffer);
531 537
@@ -635,6 +641,8 @@ _emile_tgv_data(Emile_Image *image,
635 abort(); 641 abort();
636 } 642 }
637 } /* bx,by inside blocks */ 643 } /* bx,by inside blocks */
644
645 eina_binbuf_free(data_start);
638 } /* x,y macroblocks */ 646 } /* x,y macroblocks */
639 647
640 // TODO: Add support for more unpremultiplied modes (ETC2) 648 // TODO: Add support for more unpremultiplied modes (ETC2)