Quoting Andreas Cadhalpun (2015-07-10 19:49:36)
> It is used as get_bits argument and reading 0 bits doesn't make sense.
> 
> Signed-off-by: Andreas Cadhalpun <[email protected]>
> ---
>  libavcodec/hevc.c        | 6 ++++++
>  libavcodec/hevc_parser.c | 6 ++++++
>  2 files changed, 12 insertions(+)
> 
> diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
> index 38734f0..d47af16 100644
> --- a/libavcodec/hevc.c
> +++ b/libavcodec/hevc.c
> @@ -459,6 +459,12 @@ static int hls_slice_header(HEVCContext *s)
>  
>          slice_address_length = av_ceil_log2(s->sps->ctb_width *
>                                              s->sps->ctb_height);
> +        if (slice_address_length <= 0) {
> +            av_log(s->avctx, AV_LOG_ERROR,
> +                   "Invalid slice address length: %d\n",
> +                   slice_address_length);
> +            return AVERROR_INVALIDDATA;

No, this is not invalid. Having a picture of 1x1 CTB is perfectly valid,
then the spec mandates that slice_segment_addr is 0. Does get_bits()
really not just return 0 on trying to read 0 bits?

-- 
Anton Khirnov
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to