Commit 65e50329 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/hevc_ps: Explicitly check num_tile_* for negative values

This fixes nothing but maybe helps coverity which does not see that this is failing later
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent b195aa5d
...@@ -1356,14 +1356,14 @@ int ff_hevc_decode_nal_pps(HEVCContext *s) ...@@ -1356,14 +1356,14 @@ int ff_hevc_decode_nal_pps(HEVCContext *s)
if (pps->tiles_enabled_flag) { if (pps->tiles_enabled_flag) {
pps->num_tile_columns = get_ue_golomb_long(gb) + 1; pps->num_tile_columns = get_ue_golomb_long(gb) + 1;
pps->num_tile_rows = get_ue_golomb_long(gb) + 1; pps->num_tile_rows = get_ue_golomb_long(gb) + 1;
if (pps->num_tile_columns == 0 || if (pps->num_tile_columns <= 0 ||
pps->num_tile_columns >= sps->width) { pps->num_tile_columns >= sps->width) {
av_log(s->avctx, AV_LOG_ERROR, "num_tile_columns_minus1 out of range: %d\n", av_log(s->avctx, AV_LOG_ERROR, "num_tile_columns_minus1 out of range: %d\n",
pps->num_tile_columns - 1); pps->num_tile_columns - 1);
ret = AVERROR_INVALIDDATA; ret = AVERROR_INVALIDDATA;
goto err; goto err;
} }
if (pps->num_tile_rows == 0 || if (pps->num_tile_rows <= 0 ||
pps->num_tile_rows >= sps->height) { pps->num_tile_rows >= sps->height) {
av_log(s->avctx, AV_LOG_ERROR, "num_tile_rows_minus1 out of range: %d\n", av_log(s->avctx, AV_LOG_ERROR, "num_tile_rows_minus1 out of range: %d\n",
pps->num_tile_rows - 1); pps->num_tile_rows - 1);
......
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