From: Hans de Goede Date: Sat, 7 Apr 2012 14:31:12 +0000 (+0200) Subject: libv4lconver/tinyjpeg: Fix out of bounds array usage X-Git-Tag: v4l-utils-0.9.1~274 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2a6a9e365a3289b80a473471d2444acfe0d0ef8f;p=platform%2Fupstream%2Fv4l-utils.git libv4lconver/tinyjpeg: Fix out of bounds array usage Signed-off-by: Hans de Goede --- diff --git a/lib/libv4lconvert/tinyjpeg.c b/lib/libv4lconvert/tinyjpeg.c index e308f63..967e0be 100644 --- a/lib/libv4lconvert/tinyjpeg.c +++ b/lib/libv4lconvert/tinyjpeg.c @@ -2556,7 +2556,7 @@ int tinyjpeg_get_components(struct jdec_private *priv, unsigned char **component { int i; - for (i = 0; priv->components[i] && i < COMPONENTS; i++) + for (i = 0; i < COMPONENTS && priv->components[i]; i++) components[i] = priv->components[i]; return 0; }