summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/ivtv/ivtv-controls.c
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2009-07-23 20:46:57 -0400
committerAndy Walls <awalls@radix.net>2009-07-23 20:46:57 -0400
commitf1f1d841250e56e65222123f52c87e33f58d2e87 (patch)
tree8c0d9f275aea6b2eb600272e6060284ac39d2492 /linux/drivers/media/video/ivtv/ivtv-controls.c
parentf1fdde7178e4aee3df0e79c6c181d16e75776343 (diff)
downloadmediapointer-dvb-s2-f1f1d841250e56e65222123f52c87e33f58d2e87.tar.gz
mediapointer-dvb-s2-f1f1d841250e56e65222123f52c87e33f58d2e87.tar.bz2
ivtv: Read buffer overflow
From: Roel Kluin <roel.kluin@gmail.com> This mistakenly tests against sizeof(freqs) instead of the array size. Due to the mask the only illegal value possible was 3. Priority: high Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Andy Walls <awalls@radix.net>
Diffstat (limited to 'linux/drivers/media/video/ivtv/ivtv-controls.c')
-rw-r--r--linux/drivers/media/video/ivtv/ivtv-controls.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/linux/drivers/media/video/ivtv/ivtv-controls.c b/linux/drivers/media/video/ivtv/ivtv-controls.c
index a3b77ed3f..4a9c8ce0e 100644
--- a/linux/drivers/media/video/ivtv/ivtv-controls.c
+++ b/linux/drivers/media/video/ivtv/ivtv-controls.c
@@ -17,6 +17,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include <linux/kernel.h>
#include "ivtv-driver.h"
#include "ivtv-cards.h"
@@ -281,7 +282,7 @@ int ivtv_s_ext_ctrls(struct file *file, void *fh, struct v4l2_ext_controls *c)
idx = p.audio_properties & 0x03;
/* The audio clock of the digitizer must match the codec sample
rate otherwise you get some very strange effects. */
- if (idx < sizeof(freqs))
+ if (idx < ARRAY_SIZE(freqs))
ivtv_call_all(itv, audio, s_clock_freq, freqs[idx]);
return err;
}