diff options
author | Xiang, Haihao <haihao.xiang@intel.com> | 2014-02-27 14:10:24 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2014-06-16 11:53:34 +0800 |
commit | 89dcd2e82093654d5c1ab68a9d132406dd641b34 (patch) | |
tree | fc402bf81ac5b77187fb47e425b1223695c66c8b | |
parent | ce2cc4e48e5478538fe332119bb0523db4761b44 (diff) | |
download | libva-intel-driver-89dcd2e82093654d5c1ab68a9d132406dd641b34.tar.gz libva-intel-driver-89dcd2e82093654d5c1ab68a9d132406dd641b34.tar.bz2 libva-intel-driver-89dcd2e82093654d5c1ab68a9d132406dd641b34.zip |
Check the pointer against NULL
The issue is reported by Klockwork
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
(cherry picked from commit 80d1f89388c9cb70218cd759592d2167c8845322)
-rw-r--r-- | src/gen6_mfc.c | 3 |
1 files changed, 3 insertions, 0 deletions
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; |