On 10/07/15 09:34, Anton Khirnov wrote:
> This prevents possible infinite loops with the calling code along the
> lines of while (bytestream2_get_bytes_left()) { ... }, where the reader
> does not advance.
> 
> CC: [email protected]
> ---
>  libavcodec/bytestream.h | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/bytestream.h b/libavcodec/bytestream.h
> index 3eab225..cb3573b 100644
> --- a/libavcodec/bytestream.h
> +++ b/libavcodec/bytestream.h
> @@ -70,8 +70,10 @@ static av_always_inline type bytestream2_get_ ## name ## 
> u(GetByteContext *g)  \
>  }                                                                            
>   \
>  static av_always_inline type bytestream2_get_ ## name(GetByteContext *g)     
>   \
>  {                                                                            
>   \
> -    if (g->buffer_end - g->buffer < bytes)                                   
>   \
> +    if (g->buffer_end - g->buffer < bytes) {                                 
>   \
> +        g->buffer = g->buffer_end;                                           
>   \
>          return 0;                                                            
>   \
> +    }                                                                        
>   \
>      return bytestream2_get_ ## name ## u(g);                                 
>   \
>  }                                                                            
>   \
>  static av_always_inline type bytestream2_peek_ ## name(GetByteContext *g)    
>   \
> 

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

Reply via email to