postprocess: Check ppq is null before calling pp_free_bos.
authorVinson Lee <vlee@freedesktop.org>
Sat, 3 Aug 2013 06:39:24 +0000 (23:39 -0700)
committerVinson Lee <vlee@freedesktop.org>
Tue, 6 Aug 2013 00:27:38 +0000 (17:27 -0700)
pp_free_bos dereferences ppq without a null check.

Fixes "Dereference before null check" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/auxiliary/postprocess/pp_init.c

index 201a357617adba01943b08df992622017129d140..a49a23d11d4a3e6f518b34446e130b28a8e4dcfa 100644 (file)
@@ -169,7 +169,9 @@ pp_free(struct pp_queue_t *ppq)
 {
    unsigned int i, j;
 
-   pp_free_fbos(ppq);
+   if (ppq) {
+      pp_free_fbos(ppq);
+   }
 
    if (ppq && ppq->p) {
       if (ppq->p->pipe && ppq->filters && ppq->shaders) {