Skip to content
This repository was archived by the owner on Jan 31, 2025. It is now read-only.

Commit 110a807

Browse files
committed
Check pointers against NULL before using
Signed-off-by: Xiang, Haihao <[email protected]> (cherry picked from commit cac54c9)
1 parent f1382d9 commit 110a807

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/gen9_hevc_encoder.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5825,6 +5825,9 @@ gen9_hevc_vme_gpe_init(VADriverContextP ctx,
58255825

58265826
ptr_start = (void *)i965_map_gpe_resource(&priv_ctx->res_slice_map_buffer);
58275827

5828+
if (!ptr_start)
5829+
return VA_STATUS_ERROR_UNKNOWN;
5830+
58285831
pslice_map = (struct gen9_hevc_slice_map *)ptr_start;
58295832
for (i = 0; i < encode_state->num_slice_params_ext; i++) {
58305833
slice_param = (VAEncSliceParameterBufferHEVC *)encode_state->slice_params_ext[i]->buffer;

0 commit comments

Comments
 (0)