diff mbox

[FFmpeg-devel,2/2] avcodec/hevc_ps: Change num_tile_rows/columns checks to sps->ctb_height/weight

Message ID 20190625085510.18178-2-michael@niedermayer.cc
State Accepted
Commit 3b2082c663dac93fd722289a540c1b1e24a12564
Headers show

Commit Message

Michael Niedermayer June 25, 2019, 8:55 a.m. UTC
Suggested-by: James Almer <jamrial@gmail.com>

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/hevc_ps.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

James Almer June 25, 2019, 1:32 p.m. UTC | #1
On 6/25/2019 5:55 AM, Michael Niedermayer wrote:
> Suggested-by: James Almer <jamrial@gmail.com>
> 
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/hevc_ps.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
> index 07d220a5c8..f6e80e1609 100644
> --- a/libavcodec/hevc_ps.c
> +++ b/libavcodec/hevc_ps.c
> @@ -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;
> 

LGTM
Michael Niedermayer June 30, 2019, 3:54 p.m. UTC | #2
On Tue, Jun 25, 2019 at 10:32:55AM -0300, James Almer wrote:
> On 6/25/2019 5:55 AM, Michael Niedermayer wrote:
> > Suggested-by: James Almer <jamrial@gmail.com>
> > 
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavcodec/hevc_ps.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
> > index 07d220a5c8..f6e80e1609 100644
> > --- a/libavcodec/hevc_ps.c
> > +++ b/libavcodec/hevc_ps.c
> > @@ -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;
> > 
> 
> LGTM

will apply

thanks

[...]
diff mbox

Patch

diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
index 07d220a5c8..f6e80e1609 100644
--- a/libavcodec/hevc_ps.c
+++ b/libavcodec/hevc_ps.c
@@ -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;