On Mon, Mar 04, 2013 at 11:26:52AM +0100, Luca Barbato wrote:
> The decoder assumes a single bitdepth for all the planes, the
> specification does allow that.
> 
> Avoid the possible problems pointed in CVE-2013-2277
> 
> CC: [email protected]
> ---
>  libavcodec/h264.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/libavcodec/h264.c b/libavcodec/h264.c
> index a20a6f7..15fabee 100644
> --- a/libavcodec/h264.c
> +++ b/libavcodec/h264.c
> @@ -2756,6 +2756,11 @@ static int h264_set_parameter_from_sps(H264Context *h)
>                     "VDPAU decoding does not support video colorspace.\n");
>              return AVERROR_INVALIDDATA;
>          }
> +        if (h->sps.bit_depth_luma != sps->bit_depth_chroma) {
> +            av_log_missing_feature(h->avctx,
> +                "Different bitdepth between chroma and luma", 1);
> +            return AVERROR_PATCHWELCOME;
> +        }
>          if (h->sps.bit_depth_luma >= 8 && h->sps.bit_depth_luma <= 10) {
>              h->avctx->bits_per_raw_sample = h->sps.bit_depth_luma;
>              h->cur_chroma_format_idc      = h->sps.chroma_format_idc;
> -- 

LGTM but maybe Diego wants to improve the message.
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to