• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

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

hardware/intel/intel-driver


コミットメタ情報

リビジョン9170fed321780f394e8eae4a789c31120c4e957c (tree)
日時2015-09-06 13:32:31
作者Xiang, Haihao <haihao.xiang@inte...>
コミッターXiang, Haihao

ログメッセージ

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

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>

変更サマリ

差分

--- 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: