diff options
author | Xiang, Haihao <haihao.xiang@intel.com> | 2013-07-10 14:16:02 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2013-07-10 14:18:35 +0800 |
commit | 8bf807539c1790d6eee531373131672d38c82b31 (patch) | |
tree | 9b2e736926ffab715025e264410d3317e2adb2f0 /src | |
parent | a0b06fa98887b341c8208ce40a471f1721944df2 (diff) | |
download | libva-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-x | src/i965_drv_video.c | 3 |
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) { |