From 5878ff9f5ac9b7cfd74fe87dc022b7b49b85d510 Mon Sep 17 00:00:00 2001 From: rfelker Date: Mon, 1 May 2006 02:04:09 +0000 Subject: 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 --- libmpdemux/muxer.c | 2 +- libmpdemux/stream_dvd.c | 2 +- libmpdemux/tv.c | 2 +- libmpdemux/yuv4mpeg.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'libmpdemux') 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); } -- cgit v1.2.3