summaryrefslogtreecommitdiff
path: root/src/gen6_mfd.c
diff options
context:
space:
mode:
authorLim Siew Hoon <siew.hoon.lim@intel.com>2015-08-20 18:29:09 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2015-09-06 12:53:35 +0800
commitd117b9d30a00c811eb7e636c772979de846d30c8 (patch)
tree0008fbd56e6631c5955b3dfd16495512ffb8146e /src/gen6_mfd.c
parent9170fed321780f394e8eae4a789c31120c4e957c (diff)
Fix klockwork critical message hit on calloc function usage
The calloc function maybe return NULL, it will causing memory access violation if continue using NULL C structure. Add assert function to do checking on its. bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91699 Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com>
Diffstat (limited to 'src/gen6_mfd.c')
-rwxr-xr-xsrc/gen6_mfd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gen6_mfd.c b/src/gen6_mfd.c
index 2dd05a1..5ab2db0 100755
--- a/src/gen6_mfd.c
+++ b/src/gen6_mfd.c
@@ -61,6 +61,7 @@ gen6_mfd_init_avc_surface(VADriverContextP ctx,
if (!gen6_avc_surface) {
gen6_avc_surface = calloc(sizeof(GenAvcSurface), 1);
+ assert(gen6_avc_surface);
gen6_avc_surface->base.frame_store_id = -1;
assert((obj_surface->size & 0x3f) == 0);
obj_surface->private_data = gen6_avc_surface;