• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

hardware/intel/intel-driver


Commit MetaInfo

Revisiond626ec189ed9fcaed4240e12e5b7d2f8fe6520da (tree)
Time2015-09-06 16:13:57
AuthorXiang, Haihao <haihao.xiang@inte...>
CommiterXiang, Haihao

Log Message

encode/hevc: Check slice type first in case user passes wrong parameters to driver

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
(cherry picked from commit 9170fed321780f394e8eae4a789c31120c4e957c)

Change Summary

Incremental Difference

--- a/src/i965_encoder.c
+++ b/src/i965_encoder.c
@@ -497,6 +497,7 @@ intel_encoder_check_hevc_parameter(VADriverContextP ctx,
497497 struct object_surface *obj_surface;
498498 struct object_buffer *obj_buffer;
499499 VAEncPictureParameterBufferHEVC *pic_param = (VAEncPictureParameterBufferHEVC *)encode_state->pic_param_ext->buffer;
500+ VAEncSliceParameterBufferHEVC *slice_param;
500501 int i;
501502
502503 assert(!(pic_param->decoded_curr_pic.flags & VA_PICTURE_HEVC_INVALID));
@@ -539,7 +540,18 @@ intel_encoder_check_hevc_parameter(VADriverContextP ctx,
539540
540541 for ( ; i < 15; i++)
541542 encode_state->reference_objects[i] = NULL;
542-
543+
544+ for (i = 0; i < encode_state->num_slice_params_ext; i++) {
545+ slice_param = (VAEncSliceParameterBufferHEVC *)encode_state->slice_params_ext[i]->buffer;
546+
547+ if (slice_param->slice_type != HEVC_SLICE_I &&
548+ slice_param->slice_type != HEVC_SLICE_P &&
549+ slice_param->slice_type != HEVC_SLICE_B)
550+ goto error;
551+
552+ /* TODO: add more check here */
553+ }
554+
543555 return VA_STATUS_SUCCESS;
544556
545557 error: