pp_free_bos dereferences ppq without a null check.

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

Signed-off-by: Vinson Lee <v...@freedesktop.org>
---
 src/gallium/auxiliary/postprocess/pp_init.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/postprocess/pp_init.c 
b/src/gallium/auxiliary/postprocess/pp_init.c
index 1130248..b4eb204 100644
--- a/src/gallium/auxiliary/postprocess/pp_init.c
+++ b/src/gallium/auxiliary/postprocess/pp_init.c
@@ -177,7 +177,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) {
       /* Only destroy created contexts. */
-- 
1.8.2.1

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to