Blob Blame History Raw
From 3df030fe82a31556695dc147e2a28288bbe12cf8 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Sat, 7 Apr 2012 16:31:12 +0200
Subject: [PATCH 1/5] libv4lconver/tinyjpeg: Fix out of bounds array usage

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 lib/libv4lconvert/tinyjpeg.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
 }
-- 
1.7.9.3