avcodec/hevc_ps: Change num_tile_rows/columns checks to sps->ctb_height/weight
authorMichael Niedermayer <michael@niedermayer.cc>
Tue, 25 Jun 2019 08:29:57 +0000 (10:29 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 30 Jun 2019 15:53:00 +0000 (17:53 +0200)
Suggested-by: James Almer <jamrial@gmail.com>
Reviewed-by: James Almer <jamrial@gmail.com
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/hevc_ps.c

index 07d220a..f6e80e1 100644 (file)
@@ -1588,14 +1588,14 @@ int ff_hevc_decode_nal_pps(GetBitContext *gb, AVCodecContext *avctx,
         int num_tile_rows_minus1    = get_ue_golomb(gb);
 
         if (num_tile_columns_minus1 < 0 ||
-            num_tile_columns_minus1 >= sps->width - 1) {
+            num_tile_columns_minus1 >= sps->ctb_width - 1) {
             av_log(avctx, AV_LOG_ERROR, "num_tile_columns_minus1 out of range: %d\n",
                    num_tile_columns_minus1);
             ret = num_tile_columns_minus1 < 0 ? num_tile_columns_minus1 : AVERROR_INVALIDDATA;
             goto err;
         }
         if (num_tile_rows_minus1 < 0 ||
-            num_tile_rows_minus1 >= sps->height - 1) {
+            num_tile_rows_minus1 >= sps->ctb_height - 1) {
             av_log(avctx, AV_LOG_ERROR, "num_tile_rows_minus1 out of range: %d\n",
                    num_tile_rows_minus1);
             ret = num_tile_rows_minus1 < 0 ? num_tile_rows_minus1 : AVERROR_INVALIDDATA;