Commit 80e1c93c authored by Andriy Gelman's avatar Andriy Gelman Committed by James Almer

avcodec/hevc_ps: Remove dead code in vps_id check

Since reading 4 bits always returns a value in the range [0, 15], the
check for vps_id >= HEVC_MAX_VPS_COUNT, where HEVC_MAX_VPS_COUNT = 16, is redundant.
Signed-off-by: 's avatarAndriy Gelman <andriy.gelman@gmail.com>
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent 9b611dee
...@@ -448,10 +448,6 @@ int ff_hevc_decode_nal_vps(GetBitContext *gb, AVCodecContext *avctx, ...@@ -448,10 +448,6 @@ int ff_hevc_decode_nal_vps(GetBitContext *gb, AVCodecContext *avctx,
memcpy(vps->data, gb->buffer, vps->data_size); memcpy(vps->data, gb->buffer, vps->data_size);
vps_id = get_bits(gb, 4); vps_id = get_bits(gb, 4);
if (vps_id >= HEVC_MAX_VPS_COUNT) {
av_log(avctx, AV_LOG_ERROR, "VPS id out of range: %d\n", vps_id);
goto err;
}
if (get_bits(gb, 2) != 3) { // vps_reserved_three_2bits if (get_bits(gb, 2) != 3) { // vps_reserved_three_2bits
av_log(avctx, AV_LOG_ERROR, "vps_reserved_three_2bits is not three\n"); av_log(avctx, AV_LOG_ERROR, "vps_reserved_three_2bits is not three\n");
...@@ -883,10 +879,6 @@ int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id, ...@@ -883,10 +879,6 @@ int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id,
// Coded parameters // Coded parameters
sps->vps_id = get_bits(gb, 4); sps->vps_id = get_bits(gb, 4);
if (sps->vps_id >= HEVC_MAX_VPS_COUNT) {
av_log(avctx, AV_LOG_ERROR, "VPS id out of range: %d\n", sps->vps_id);
return AVERROR_INVALIDDATA;
}
if (vps_list && !vps_list[sps->vps_id]) { if (vps_list && !vps_list[sps->vps_id]) {
av_log(avctx, AV_LOG_ERROR, "VPS %d does not exist\n", av_log(avctx, AV_LOG_ERROR, "VPS %d does not exist\n",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment