summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-12-18 21:36:15 +0100
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-12-18 21:36:15 +0100
commitcf22e0aa95b17a8ea15f9d3cc3fb6b458aac8ed3 (patch)
treede3e2d3af87220215beebdbe77ead6b589b338ea
parent8de6eaea0323456e20bc2547074306e8d610ff3e (diff)
downloadxine-lib-cf22e0aa95b17a8ea15f9d3cc3fb6b458aac8ed3.tar.gz
xine-lib-cf22e0aa95b17a8ea15f9d3cc3fb6b458aac8ed3.tar.bz2
Use calloc() when allocating an array of elements.
(transplanted from 3640d3cbe551f96df932b7d6218b071b910a237b) --HG-- extra : transplant_source : 6%40%D3%CB%E5Q%F9m%F92%B7%D6%21%8B%07%1B%91%0A%23%7B
-rw-r--r--src/demuxers/demux_real.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c
index 761c55bf8..6e6ce6f4f 100644
--- a/src/demuxers/demux_real.c
+++ b/src/demuxers/demux_real.c
@@ -284,17 +284,17 @@ static mdpr_t *real_parse_mdpr(const char *data) {
mdpr->duration=_X_BE_32(&data[28]);
mdpr->stream_name_size=data[32];
- mdpr->stream_name=malloc(sizeof(char)*(mdpr->stream_name_size+1));
+ mdpr->stream_name=calloc(mdpr->stream_name_size+1, sizeof(char));
memcpy(mdpr->stream_name, &data[33], mdpr->stream_name_size);
mdpr->stream_name[(int)mdpr->stream_name_size]=0;
mdpr->mime_type_size=data[33+mdpr->stream_name_size];
- mdpr->mime_type=malloc(sizeof(char)*(mdpr->mime_type_size+1));
+ mdpr->mime_type=calloc(mdpr->mime_type_size+1, sizeof(char));
memcpy(mdpr->mime_type, &data[34+mdpr->stream_name_size], mdpr->mime_type_size);
mdpr->mime_type[(int)mdpr->mime_type_size]=0;
mdpr->type_specific_len=_X_BE_32(&data[34+mdpr->stream_name_size+mdpr->mime_type_size]);
- mdpr->type_specific_data=malloc(sizeof(char)*(mdpr->type_specific_len));
+ mdpr->type_specific_data=calloc(mdpr->type_specific_len, sizeof(char));
memcpy(mdpr->type_specific_data,
&data[38+mdpr->stream_name_size+mdpr->mime_type_size], mdpr->type_specific_len);