[FFmpeg-devel] [PATCH]lavc/h264_ps: Check chroma_location limits

wm4 nfxjfg at googlemail.com
Fri Mar 24 11:59:53 EET 2017


On Fri, 24 Mar 2017 10:40:21 +0100
Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:

> From 1c249440c62271565be12112f321ad9aa6a922fb Mon Sep 17 00:00:00 2001
> From: Carl Eugen Hoyos <cehoyos at ag.or.at>
> Date: Fri, 24 Mar 2017 10:38:22 +0100
> Subject: [PATCH] lavc/h264_ps: Check that chroma_location is within limits.
> 
> Fixes ticket #6255.
> ---
>  libavcodec/h264_ps.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
> index b78ad25..55e6a6e 100644
> --- a/libavcodec/h264_ps.c
> +++ b/libavcodec/h264_ps.c
> @@ -181,6 +181,8 @@ static inline int decode_vui_parameters(GetBitContext *gb, AVCodecContext *avctx
>      if (get_bits1(gb)) {
>          /* chroma_sample_location_type_top_field */
>          avctx->chroma_sample_location = get_ue_golomb(gb) + 1;
> +        if (avctx->chroma_sample_location >= AVCHROMA_LOC_NB)
> +            avctx->chroma_sample_location = AVCHROMA_LOC_UNSPECIFIED;

AVCHROMA_LOC_NB is not part of the libavutil ABI, so libavcodec can in
theory not use it.

>          get_ue_golomb(gb);  /* chroma_sample_location_type_bottom_field */
>      }
>  



More information about the ffmpeg-devel mailing list