am 5696adb5: Validate the u4_entropy_coding_mode field

* commit '5696adb5ec':
  Validate the u4_entropy_coding_mode field
This commit is contained in:
Martin Storsjo 2015-07-28 20:32:35 +00:00 committed by Android Git Automerger
commit 1da9fc7cd8
2 changed files with 12 additions and 0 deletions

View file

@ -1758,6 +1758,15 @@ static IV_STATUS_T api_check_struct_sanity(iv_obj_t *ps_handle,
return IV_FAIL;
}
if (ps_ip->s_ive_ip.u4_entropy_coding_mode > 1)
{
ps_op->s_ive_op.u4_error_code |= 1
<< IVE_UNSUPPORTEDPARAM;
ps_op->s_ive_op.u4_error_code |=
IH264E_INVALID_ENTROPY_CODING_MODE;
return IV_FAIL;
}
break;
}

View file

@ -223,6 +223,9 @@ typedef enum
/**Not enough memory allocated as output buffer */
IH264E_INSUFFICIENT_OUTPUT_BUFFER = IH264E_CODEC_ERROR_START + 0x30,
/**Invalid entropy coding mode */
IH264E_INVALID_ENTROPY_CODING_MODE = IH264E_CODEC_ERROR_START + 0x31,
/**max failure error code to ensure enum is 32 bits wide */
IH264E_FAIL = -1,