Code review warning cleanup.

Signed-off-by: zhenghongda6 <1831479265@qq.com>
This commit is contained in:
zhenghongda6 2024-10-28 06:56:39 +00:00
parent 42494870e0
commit b417b56247
2 changed files with 2 additions and 2 deletions

View File

@ -182,7 +182,7 @@ static void h264_mp4toannexb_modify_encryption_info(AVPacket *pkt, uint64_t new_
return;
}
side_data = (AV_DrmCencInfo *)av_packet_get_side_data(pkt, AV_PKT_DATA_ENCRYPTION_INFO, &side_data_size);
if ((side_data != NULL) && (side_data_size != 0)) {
if ((side_data != NULL) && (side_data_size != 0) && (side_data->sub_sample_num <= AV_DRM_MAX_SUB_SAMPLE_NUM)) {
uint64_t total_size = 0;
for (uint32_t i = 0; i < side_data->sub_sample_num; i++) {
total_size +=

View File

@ -669,7 +669,7 @@ static int mpegts_drm_get_iv(uint8_t *data, uint32_t data_size, uint32_t *pos, A
}
uint32_t iv_len = (uint32_t)(data[offset]);
offset += 1; // 1 skip iv len
if (offset + iv_len > data_size) {
if ((offset + iv_len > data_size) || (iv_len > AV_DRM_IV_SIZE)) {
av_log(NULL, AV_LOG_ERROR, "cei data too short\n");
return -1;
} else {