mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-28 22:06:59 +01:00
audio: check packet buffers only during decode
This commit is contained in:
@@ -775,6 +775,7 @@ static int32_t audiodec_validate_ctrl(const AudiodecCtrl* ctrl, uint32_t codec_t
|
|||||||
if (ctrl->pBsiInfo == nullptr) {
|
if (ctrl->pBsiInfo == nullptr) {
|
||||||
return AUDIODEC_ERROR_INVALID_BSI_INFO_POINTER;
|
return AUDIODEC_ERROR_INVALID_BSI_INFO_POINTER;
|
||||||
}
|
}
|
||||||
|
if (decode) {
|
||||||
if (ctrl->pAuInfo == nullptr) {
|
if (ctrl->pAuInfo == nullptr) {
|
||||||
return AUDIODEC_ERROR_INVALID_AU_INFO_POINTER;
|
return AUDIODEC_ERROR_INVALID_AU_INFO_POINTER;
|
||||||
}
|
}
|
||||||
@@ -787,12 +788,13 @@ static int32_t audiodec_validate_ctrl(const AudiodecCtrl* ctrl, uint32_t codec_t
|
|||||||
if (ctrl->pPcmItem->uiSize != sizeof(AudiodecPcmItem)) {
|
if (ctrl->pPcmItem->uiSize != sizeof(AudiodecPcmItem)) {
|
||||||
return AUDIODEC_ERROR_INVALID_PCM_ITEM_SIZE;
|
return AUDIODEC_ERROR_INVALID_PCM_ITEM_SIZE;
|
||||||
}
|
}
|
||||||
if (decode && ctrl->pAuInfo->pAuAddr == nullptr) {
|
if (ctrl->pAuInfo->pAuAddr == nullptr) {
|
||||||
return AUDIODEC_ERROR_INVALID_AU_POINTER;
|
return AUDIODEC_ERROR_INVALID_AU_POINTER;
|
||||||
}
|
}
|
||||||
if (decode && ctrl->pPcmItem->pPcmAddr == nullptr) {
|
if (ctrl->pPcmItem->pPcmAddr == nullptr) {
|
||||||
return AUDIODEC_ERROR_INVALID_PCM_POINTER;
|
return AUDIODEC_ERROR_INVALID_PCM_POINTER;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch (codec_type) {
|
switch (codec_type) {
|
||||||
case AUDIODEC_TYPE_AT9: {
|
case AUDIODEC_TYPE_AT9: {
|
||||||
|
|||||||
Reference in New Issue
Block a user