summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXiang, Haihao <haihao.xiang@intel.com>2013-07-10 14:16:02 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2013-07-10 14:18:35 +0800
commit8bf807539c1790d6eee531373131672d38c82b31 (patch)
tree9b2e736926ffab715025e264410d3317e2adb2f0 /src
parenta0b06fa98887b341c8208ce40a471f1721944df2 (diff)
downloadlibva-intel-driver-8bf807539c1790d6eee531373131672d38c82b31.tar.gz
Check the returned pointer from malloc() before using it
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com> (cherry picked from commit 1caf179b1425b13cacaa421c688c6df8369668c6)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/i965_drv_video.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
index 606e2795..40977502 100755
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -4291,6 +4291,9 @@ i965_QuerySurfaceAttributes(VADriverContextP ctx,
attribs = malloc(I965_MAX_SURFACE_ATTRIBUTES *sizeof(*attribs));
+ if (attribs == NULL)
+ return VA_STATUS_ERROR_ALLOCATION_FAILED;
+
if (IS_G4X(i965->intel.device_id)) {
if (obj_config->profile == VAProfileMPEG2Simple ||
obj_config->profile == VAProfileMPEG2Main) {