[Libva] [PATCH] test/decode/tinyjpeg: make sure the pointer is valid before dereferencing it

Sean V Kelley seanvk at posteo.de
Wed Jun 10 09:23:48 PDT 2015


> On Jun 9, 2015, at 23:41, Xiang, Haihao <haihao.xiang at intel.com> wrote:
> 
> Signed-off-by: Xiang, Haihao <haihao.xiang at intel.com>



lgtm, thanks.

Sean


> ---
> test/decode/tinyjpeg.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/test/decode/tinyjpeg.c b/test/decode/tinyjpeg.c
> index 10ff99b..e4747b4 100644
> --- a/test/decode/tinyjpeg.c
> +++ b/test/decode/tinyjpeg.c
> @@ -388,7 +388,7 @@ static int parse_DRI(struct jdec_private *priv, const unsigned char *stream)
> 
> static int findEOI(struct jdec_private *priv,const unsigned char *stream)
> {
> -   while (!(*stream == 0xff  && *(stream+1) == 0xd9 )&& stream<=priv->stream_end) //searching for the end of image marker
> +   while (stream<=priv->stream_end&& !(*stream == 0xff  && *(stream+1) == 0xd9 )) //searching for the end of image marker
>    {
>       stream++;
>       continue;
> -- 
> 1.9.1
> 
> _______________________________________________
> Libva mailing list
> Libva at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/libva



More information about the Libva mailing list