mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-14 05:13:44 +08:00
[h264e_codec]: modify H264E input parameter validation
modify H264EncStrmEncode input paramter validation Change-Id: I578671f6ca94aa85dc5876f7e1039378c60595f4 Signed-off-by: Lin Kesheng <lks@rock-chips.com>
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define MODULE_TAG "h264e_api"
|
#define MODULE_TAG "H264EncApi"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@@ -583,11 +583,22 @@ H264EncRet H264EncStrmEncode(H264ECtx *pEncInst, const H264EncIn * pEncIn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check for invalid input values */
|
/* Check for invalid input values */
|
||||||
if ((!H264_BUS_ADDRESS_VALID(pEncIn->busOutBuf)) ||
|
if ((!H264_BUS_ADDRESS_VALID(pEncIn->busOutBuf))) {
|
||||||
(pEncIn->pOutBuf == NULL) ||
|
mpp_err_f("ERROR Invalid input busOutBuf is NULL\n");
|
||||||
(pEncIn->outBufSize < H264ENCSTRMENCODE_MIN_BUF) ||
|
return H264ENC_INVALID_ARGUMENT;
|
||||||
(pEncIn->codingType > H264ENC_PREDICTED_FRAME)) {
|
}
|
||||||
mpp_err_f("ERROR Invalid input. Output buffer\n");
|
if (pEncIn->pOutBuf == NULL) {
|
||||||
|
mpp_err_f("ERROR Invalid input pOutBuf is NULL\n");
|
||||||
|
return H264ENC_INVALID_ARGUMENT;
|
||||||
|
}
|
||||||
|
if (pEncIn->outBufSize < H264ENCSTRMENCODE_MIN_BUF) {
|
||||||
|
mpp_err_f("ERROR Invalid input outBufSize %d < min size %d\n",
|
||||||
|
pEncIn->outBufSize, H264ENCSTRMENCODE_MIN_BUF);
|
||||||
|
return H264ENC_INVALID_ARGUMENT;
|
||||||
|
}
|
||||||
|
if (pEncIn->codingType > H264ENC_PREDICTED_FRAME) {
|
||||||
|
mpp_err_f("ERROR Invalid input codingType %d < predicted %d\n",
|
||||||
|
pEncIn->codingType, H264ENC_PREDICTED_FRAME);
|
||||||
return H264ENC_INVALID_ARGUMENT;
|
return H264ENC_INVALID_ARGUMENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user