From ac532d001dbd78c75ab437d4b1d975f11221c2b7 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 4 Aug 2008 19:32:35 +0200 Subject: v4l: fix compile errors/warnings. From: Hans Verkuil Signed-off-by: Hans Verkuil --- linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c | 4 ---- linux/drivers/media/video/tvmixer.c | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c index 0fdcb19cb..4c233c41f 100644 --- a/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c +++ b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c @@ -1284,11 +1284,7 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec) u8 b1[] = { 0x61 }; u8 *b; char idstring[21]; -#ifndef TTUSB_KERNEL - u8 *firmware = NULL; -#else const u8 *firmware = NULL; -#endif size_t firmware_size = 0; u16 firmware_csum = 0; __be16 firmware_csum_ns; diff --git a/linux/drivers/media/video/tvmixer.c b/linux/drivers/media/video/tvmixer.c index 7c1e1a850..fd2e902ea 100644 --- a/linux/drivers/media/video/tvmixer.c +++ b/linux/drivers/media/video/tvmixer.c @@ -9,6 +9,7 @@ #include #include #include +#include #include "compat.h" #include #include -- cgit v1.2.3 From 053556a4eefa963d9b4c6dd40cbf8a51579753f1 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 4 Aug 2008 19:42:57 +0200 Subject: v4l2-dbg/v4l2-ctl: fix buffer overrun. From: Hans Verkuil Signed-off-by: Hans Verkuil --- v4l2-apps/util/v4l2-ctl.cpp | 9 +++++---- v4l2-apps/util/v4l2-dbg.cpp | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/v4l2-apps/util/v4l2-ctl.cpp b/v4l2-apps/util/v4l2-ctl.cpp index 920fbd1a3..41946978a 100644 --- a/v4l2-apps/util/v4l2-ctl.cpp +++ b/v4l2-apps/util/v4l2-ctl.cpp @@ -1148,7 +1148,7 @@ int main(int argc, char **argv) /* command args */ int ch; - char *device = strdup("/dev/video0"); /* -d device */ + const char *device = "/dev/video0"; /* -d device */ struct v4l2_format vfmt; /* set_format/get_format for video */ struct v4l2_format vfmt_out; /* set_format/get_format video output */ struct v4l2_format vbi_fmt; /* set_format/get_format for sliced VBI */ @@ -1224,11 +1224,13 @@ int main(int argc, char **argv) usage(); return 0; case OptSetDevice: - device = strdup(optarg); + device = optarg; if (device[0] >= '0' && device[0] <= '9' && device[1] == 0) { + static char newdev[20]; char dev = device[0]; - sprintf(device, "/dev/video%c", dev); + sprintf(newdev, "/dev/video%c", dev); + device = newdev; } break; case OptSetVideoFormat: @@ -1496,7 +1498,6 @@ int main(int argc, char **argv) strerror(errno)); exit(1); } - free(device); doioctl(fd, VIDIOC_QUERYCAP, &vcap, "VIDIOC_QUERYCAP"); capabilities = vcap.capabilities; diff --git a/v4l2-apps/util/v4l2-dbg.cpp b/v4l2-apps/util/v4l2-dbg.cpp index 0ffd9de64..2561f42b2 100644 --- a/v4l2-apps/util/v4l2-dbg.cpp +++ b/v4l2-apps/util/v4l2-dbg.cpp @@ -272,7 +272,7 @@ int main(int argc, char **argv) /* command args */ int ch; - char *device = strdup("/dev/video0"); /* -d device */ + const char *device = "/dev/video0"; /* -d device */ struct v4l2_capability vcap; /* list_cap */ struct v4l2_register set_reg; struct v4l2_register get_reg; @@ -311,11 +311,13 @@ int main(int argc, char **argv) usage(); return 0; case OptSetDevice: - device = strdup(optarg); + device = optarg; if (device[0] >= '0' && device[0] <= '9' && device[1] == 0) { + static char newdev[20]; char dev = device[0]; - sprintf(device, "/dev/video%c", dev); + sprintf(newdev, "/dev/video%c", dev); + device = newdev; } break; case OptSetRegister: @@ -424,7 +426,6 @@ int main(int argc, char **argv) strerror(errno)); exit(1); } - free(device); doioctl(fd, VIDIOC_QUERYCAP, &vcap, "VIDIOC_QUERYCAP"); capabilities = vcap.capabilities; -- cgit v1.2.3 From d1bc61a9a24dd11c7c73b4bc31aa691a69ae0dc2 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 4 Aug 2008 19:49:24 +0200 Subject: ivtv/cx18-ctl: fix same overrun. From: Hans Verkuil Signed-off-by: Hans Verkuil --- v4l2-apps/util/cx18-ctl.c | 9 +++++---- v4l2-apps/util/ivtv-ctl.c | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/v4l2-apps/util/cx18-ctl.c b/v4l2-apps/util/cx18-ctl.c index 755b9437f..4081f3aef 100644 --- a/v4l2-apps/util/cx18-ctl.c +++ b/v4l2-apps/util/cx18-ctl.c @@ -267,7 +267,7 @@ int main(int argc, char **argv) /* bitfield for OptSetCodec */ /* command args */ - char *device = strdup("/dev/video0"); /* -d device */ + const char *device = "/dev/video0"; /* -d device */ int ch; int yuv_mode = 0; struct v4l2_routing route; /* audio_route */ @@ -312,11 +312,13 @@ int main(int argc, char **argv) break; } case OptSetDevice: - device = strdup(optarg); + device = optarg; if (device[0] >= '0' && device[0] <= '9' && device[1] == 0) { + static char newdev[20]; char dev = device[0]; - sprintf(device, "/dev/video%c", dev); + sprintf(newdev, "/dev/video%c", dev); + device = newdev; } break; case OptSetAudioRoute: @@ -410,7 +412,6 @@ int main(int argc, char **argv) strerror(errno)); exit(1); } - free(device); /* Setting Opts */ diff --git a/v4l2-apps/util/ivtv-ctl.c b/v4l2-apps/util/ivtv-ctl.c index 9d3170785..ab836e240 100644 --- a/v4l2-apps/util/ivtv-ctl.c +++ b/v4l2-apps/util/ivtv-ctl.c @@ -343,7 +343,7 @@ int main(int argc, char **argv) /* bitfield for OptSetCodec */ /* command args */ - char *device = strdup("/dev/video0"); /* -d device */ + const char *device = "/dev/video0"; /* -d device */ int ch; int yuv_mode = 0; struct v4l2_routing route; /* audio_route */ @@ -415,11 +415,13 @@ int main(int argc, char **argv) break; } case OptSetDevice: - device = strdup(optarg); + device = optarg; if (device[0] >= '0' && device[0] <= '9' && device[1] == 0) { + static char newdev[20]; char dev = device[0]; - sprintf(device, "/dev/video%c", dev); + sprintf(newdev, "/dev/video%c", dev); + device = newdev; } break; case OptSetAudioRoute: @@ -524,7 +526,6 @@ int main(int argc, char **argv) strerror(errno)); exit(1); } - free(device); /* Setting Opts */ -- cgit v1.2.3