fix warnings in evas filter plus a memleak in _vflip_cpu()
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Sat, 8 Feb 2014 03:15:35 +0000 (12:15 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Sat, 8 Feb 2014 03:15:35 +0000 (12:15 +0900)
src/lib/evas/filters/evas_filter.c
src/lib/evas/filters/evas_filter_parser.c
src/lib/evas/filters/evas_filter_transform.c

index fc3f462cbe82c37ef1e3849596f4961a085d9110..ee510daa25faff4b9b8fd81c4264b369f30f137f 100644 (file)
@@ -803,7 +803,7 @@ evas_filter_command_blur_add(Evas_Filter_Context *ctx, void *drawctx,
                              int inbuf, int outbuf, Evas_Filter_Blur_Type type,
                              int dx, int dy, int ox, int oy)
 {
-   Evas_Filter_Command *cmd;
+   Evas_Filter_Command *cmd = NULL;
    Evas_Filter_Buffer *in = NULL, *out = NULL, *tmp = NULL, *in_dy = NULL;
    Evas_Filter_Buffer *out_dy = NULL, *out_dx = NULL;
    Evas_Filter_Buffer *copybuf = NULL, *blur_out = NULL;
@@ -951,6 +951,7 @@ evas_filter_command_blur_add(Evas_Filter_Context *ctx, void *drawctx,
 
    if (copy_back)
      {
+        if (!cmd) goto fail;
         INF("Add copy %d -> %d", copybuf->id, blur_out->id);
         cmd->ENFN->context_color_set(cmd->ENDT, drawctx, 0, 0, 0, 255);
         id = evas_filter_command_blend_add(ctx, drawctx, copybuf->id, blur_out->id, ox, oy, EVAS_FILTER_FILL_MODE_NONE);
index e24dfbc3b45a5668665ba01eb3368b8d9c55ee2b..58021671b181046f9468e5c562c06528500b29cc 100644 (file)
@@ -1683,7 +1683,7 @@ _instr2cmd_curve(Evas_Filter_Context *ctx, Evas_Filter_Program *pgm,
    const char *src, *dst, *points_str, *interpolation, *channel_name;
    DATA8 values[256] = {0}, points[512];
    int cmdid, point_count = 0;
-   char *token, *copy, *saveptr;
+   char *token, *copy = NULL, *saveptr;
    Buffer *in, *out;
    Eina_Bool parse_ok = EINA_FALSE;
 
index bc9f65d9149a0197917daa36aa62862582a0a00c..eaf1289a292648df55a4289da278cf460f59112f 100644 (file)
@@ -4,7 +4,7 @@ static Eina_Bool
 _vflip_cpu(Evas_Filter_Command *cmd)
 {
    size_t datasize, stride;
-   DATA8 *in, *out, *span;
+   DATA8 *in, *out, *span = NULL;
    int w, h, sy, dy, oy, center, t, b, objh;
    int s0, s1, d0, d1;
 
@@ -66,7 +66,7 @@ _vflip_cpu(Evas_Filter_Command *cmd)
         else
           memcpy(dst, src, stride);
      }
-
+   free(span);
    return EINA_TRUE;
 }