Aneesh Dogra <[email protected]> writes:

> ---
>  libavcodec/4xm.c |    8 +++++++-
>  1 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c
> index 21bde52..841adbb 100644
> --- a/libavcodec/4xm.c
> +++ b/libavcodec/4xm.c
> @@ -132,7 +132,8 @@ typedef struct FourXContext{
>      AVFrame current_picture, last_picture;
>      GetBitContext pre_gb;          ///< ac/dc prefix
>      GetBitContext gb;
> -    const uint8_t *bytestream;
> +    const uint8_t *bytestream ;

Accidental space inserted.

> +    const uint8_t *bytestream_end;
>      const uint16_t *wordstream;
>      int mv[256];
>      VLC pre_vlc;
> @@ -328,6 +329,8 @@ static void decode_p_block(FourXContext *f, uint16_t 
> *dst, uint16_t *src, int lo
>      assert(code>=0 && code<=6);
>
>      if(code == 0){
> +        if (f->bytestream > f->bytestream_end)

>=, but that's not proper either.

> +            return;
>          src += f->mv[ *f->bytestream++ ];
>          if(start > src || src > end){
>              av_log(f->avctx, AV_LOG_ERROR, "mv out of pic\n");
> @@ -345,6 +348,8 @@ static void decode_p_block(FourXContext *f, uint16_t 
> *dst, uint16_t *src, int lo
>      }else if(code == 3 && f->version<2){
>          mcdc(dst, src, log2w, h, stride, 1, 0);
>      }else if(code == 4){
> +        if (f->bytestream > f->bytestream_end)
> +            return;

I have the feeling these checks are not in the best locations.

-- 
Måns Rullgård
[email protected]
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to