summaryrefslogtreecommitdiff
path: root/src/demuxers/demux_real.c
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-12-19 03:06:12 +0100
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-12-19 03:06:12 +0100
commitdba3aa42580ef3e9cba57df71a231bc00679c551 (patch)
tree2f2d45468bb5669b4a0e1e95a2369479715e60ac /src/demuxers/demux_real.c
parent916fbee057ef45a6b7b9dbee93784b16820f6b95 (diff)
parent75b8595548ee1796fd81e2b5a0a3bc99ee74265d (diff)
downloadxine-lib-dba3aa42580ef3e9cba57df71a231bc00679c551.tar.gz
xine-lib-dba3aa42580ef3e9cba57df71a231bc00679c551.tar.bz2
Merge from 1.2 branch.
--HG-- rename : src/xine-utils/xineutils.h => include/xine/xineutils.h
Diffstat (limited to 'src/demuxers/demux_real.c')
-rw-r--r--src/demuxers/demux_real.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c
index c14be6b47..bd5bb4021 100644
--- a/src/demuxers/demux_real.c
+++ b/src/demuxers/demux_real.c
@@ -275,19 +275,13 @@ 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=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->stream_name=xine_memdup0(&data[33], mdpr->stream_name_size);
mdpr->mime_type_size=data[33+mdpr->stream_name_size];
- 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->mime_type=xine_memdup0(&data[34+mdpr->stream_name_size], mdpr->mime_type_size);
mdpr->type_specific_len=_X_BE_32(&data[34+mdpr->stream_name_size+mdpr->mime_type_size]);
- 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);
+ mdpr->type_specific_data=xine_memdup(&data[38+mdpr->stream_name_size+mdpr->mime_type_size], mdpr->type_specific_len);
lprintf("MDPR: stream number: %i\n", mdpr->stream_number);
lprintf("MDPR: maximal bit rate: %i\n", mdpr->max_bit_rate);