diff options
author | Xiang, Haihao <haihao.xiang@intel.com> | 2015-06-10 14:41:14 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2015-06-12 09:27:58 +0800 |
commit | 5d07b29687db6d17811b7ecf9b779377e9851a27 (patch) | |
tree | 8da862aeee290344305a52d98798f134f5130b99 /test | |
parent | 1fe4f3593857839cd0b4f92c033528bc569014cf (diff) | |
download | libva-5d07b29687db6d17811b7ecf9b779377e9851a27.tar.gz |
test/decode/tinyjpeg: make sure the pointer is valid before dereferencing it
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Reviewed-by: Sean V Kelley <seanvk@posteo.de>
(cherry picked from commit 8455834161bab3374fe9756fd4a28d919027daf7)
Diffstat (limited to 'test')
-rw-r--r-- | test/decode/tinyjpeg.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/decode/tinyjpeg.c b/test/decode/tinyjpeg.c index 33dcdc6..f53d083 100644 --- a/test/decode/tinyjpeg.c +++ b/test/decode/tinyjpeg.c @@ -387,7 +387,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; |