ector: Fix Coverity CID1293003
authorChris Michael <cp.michael@samsung.com>
Mon, 13 Apr 2015 00:51:31 +0000 (20:51 -0400)
committerChris Michael <cp.michael@samsung.com>
Mon, 13 Apr 2015 01:13:18 +0000 (21:13 -0400)
Summary: This fixes an issue of coverity reporting Explicit null
dereference as fetchfunc is defaulted to NULL, yet no check is made
later before calling it.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/lib/ector/software/ector_software_rasterizer.c

index 71eaa1f688ebb5a4af3bc90aa3975ccbdb483cb9..495e50fc4f4261a4406c758387773e74afd1f6eb 100644 (file)
@@ -80,7 +80,8 @@ _blend_gradient(int count, const SW_FT_Span *spans, void *user_data)
          while (length)
            {
               int l = MIN(length, buffer_size);
-              fetchfunc(buffer, data, spans->y, spans->x, l);
+              if (fetchfunc)
+                fetchfunc(buffer, data, spans->y, spans->x, l);
               if (data->mul_col == 0xffffffff)
                 _ector_comp_func_source_over(target, buffer, l, spans->coverage); // TODO use proper composition func
               else