summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authorrfelker <rfelker@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-05-01 02:04:09 +0000
committerrfelker <rfelker@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-05-01 02:04:09 +0000
commit5878ff9f5ac9b7cfd74fe87dc022b7b49b85d510 (patch)
treeb26ee91c1fa3f1fee2e70d8c0185ae01d39e8537 /libmpdemux
parent40b6f59ac40789b51eaea28da5a3c2d13ba18098 (diff)
downloadmpv-5878ff9f5ac9b7cfd74fe87dc022b7b49b85d510.tar.bz2
mpv-5878ff9f5ac9b7cfd74fe87dc022b7b49b85d510.tar.xz
100000l to the fools who don't know C
These were all found while auditing for malloc(A*B) type bugs. Removing them makes it easier to find real incorrect usage and makes the code more readable. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18367 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/muxer.c2
-rw-r--r--libmpdemux/stream_dvd.c2
-rw-r--r--libmpdemux/tv.c2
-rw-r--r--libmpdemux/yuv4mpeg.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/libmpdemux/muxer.c b/libmpdemux/muxer.c
index c59d3b1467..066443fefd 100644
--- a/libmpdemux/muxer.c
+++ b/libmpdemux/muxer.c
@@ -82,7 +82,7 @@ void muxer_write_chunk(muxer_stream_t *s, size_t len, unsigned int flags, double
buf->pts= pts;
buf->len = len;
buf->flags = flags;
- buf->buffer = malloc(len * sizeof (unsigned char));
+ buf->buffer = malloc(len);
if (!buf->buffer) {
mp_msg(MSGT_MUXER, MSGL_FATAL, MSGTR_MuxbufMallocErr);
return;
diff --git a/libmpdemux/stream_dvd.c b/libmpdemux/stream_dvd.c
index 4d0a4cc3c2..341f706ef9 100644
--- a/libmpdemux/stream_dvd.c
+++ b/libmpdemux/stream_dvd.c
@@ -518,7 +518,7 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
/* Dynamic DVD drive selection on Darwin */
if(!strcmp(dvd_device, "/dev/rdiskN")) {
int i;
- char *temp_device = malloc((strlen(dvd_device)+1)*sizeof(char));
+ char *temp_device = malloc(strlen(dvd_device)+1);
for (i = 1; i < 10; i++) {
sprintf(temp_device, "/dev/rdisk%d", i);
diff --git a/libmpdemux/tv.c b/libmpdemux/tv.c
index 87f95a9dca..3939ab11f5 100644
--- a/libmpdemux/tv.c
+++ b/libmpdemux/tv.c
@@ -375,7 +375,7 @@ static int open_tv(tvi_handle_t *tvh)
tv_channel_current->prev->next = NULL;
free(tv_channel_current);
} else
- tv_channel_last_real = malloc(sizeof(char)*5);
+ tv_channel_last_real = malloc(5);
if (tv_channel_list) {
int i;
diff --git a/libmpdemux/yuv4mpeg.c b/libmpdemux/yuv4mpeg.c
index f746da21c2..e22cc11de8 100644
--- a/libmpdemux/yuv4mpeg.c
+++ b/libmpdemux/yuv4mpeg.c
@@ -103,7 +103,7 @@ ssize_t y4m_write(int fd, char *buf, size_t len)
static char *y4m_new_xtag(void)
{
- return _y4m_alloc(Y4M_MAX_XTAG_SIZE * sizeof(char));
+ return _y4m_alloc(Y4M_MAX_XTAG_SIZE);
}