[FFmpeg-devel] [PATCH 1/3] hevc: Allow parsing external extradata buffers

Michael Niedermayer michael at niedermayer.cc
Tue Nov 29 04:01:28 EET 2016


On Tue, Nov 08, 2016 at 05:03:26PM -0500, Vittorio Giovara wrote:
> ---
> As mentioned in the discussion.
> Please CC.
> Vittorio
> 
>  libavcodec/hevc.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
> index 29e0d49..02fd606 100644
> --- a/libavcodec/hevc.c
> +++ b/libavcodec/hevc.c
> @@ -2973,17 +2973,15 @@ static int verify_md5(HEVCContext *s, AVFrame *frame)
>      return 0;
>  }
>  
> -static int hevc_decode_extradata(HEVCContext *s)
> +static int hevc_decode_extradata(HEVCContext *s, uint8_t *buf, int length)
>  {
>      AVCodecContext *avctx = s->avctx;
>      GetByteContext gb;
>      int ret, i;
>  
> -    bytestream2_init(&gb, avctx->extradata, avctx->extradata_size);
> +    bytestream2_init(&gb, buf, length);
>  
> -    if (avctx->extradata_size > 3 &&
> -        (avctx->extradata[0] || avctx->extradata[1] ||
> -         avctx->extradata[2] > 1)) {
> +    if (avctx->extradata_size > 3 && (buf[0] || buf[1] || buf[2] > 1)) {
           ^^^^^^^^^^^^^^^^^^^^^

is that intended to stay extradata_size ?

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20161129/01db6e45/attachment.sig>


More information about the ffmpeg-devel mailing list