From 89dcd2e82093654d5c1ab68a9d132406dd641b34 Mon Sep 17 00:00:00 2001 From: "Xiang, Haihao" Date: Thu, 27 Feb 2014 14:10:24 +0800 Subject: Check the pointer against NULL The issue is reported by Klockwork Signed-off-by: Xiang, Haihao (cherry picked from commit 80d1f89388c9cb70218cd759592d2167c8845322) --- src/gen6_mfc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gen6_mfc.c b/src/gen6_mfc.c index 987fa52..21db0a7 100644 --- a/src/gen6_mfc.c +++ b/src/gen6_mfc.c @@ -1480,6 +1480,9 @@ Bool gen6_mfc_context_init(VADriverContextP ctx, struct intel_encoder_context *e { struct gen6_mfc_context *mfc_context = calloc(1, sizeof(struct gen6_mfc_context)); + if (!mfc_context) + return False; + mfc_context->gpe_context.surface_state_binding_table.length = (SURFACE_STATE_PADDED_SIZE + sizeof(unsigned int)) * MAX_MEDIA_SURFACES_GEN6; mfc_context->gpe_context.idrt.max_entries = MAX_GPE_KERNELS; -- cgit v1.2.3