isl_tab_pip.c: context_gbr_save: avoid invalid access on error path
authorSven Verdoolaege <skimo@kotnet.org>
Tue, 4 Jun 2013 12:27:57 +0000 (14:27 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Tue, 4 Jun 2013 12:30:58 +0000 (14:30 +0200)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_tab_pip.c

index 6d8496e..7fb34c7 100644 (file)
@@ -3222,6 +3222,9 @@ static void *context_gbr_save(struct isl_context *context)
        struct isl_context_gbr *cgbr = (struct isl_context_gbr *)context;
        struct isl_gbr_tab_undo *snap;
 
+       if (!cgbr->tab)
+               return NULL;
+
        snap = isl_alloc_type(cgbr->tab->mat->ctx, struct isl_gbr_tab_undo);
        if (!snap)
                return NULL;