diff options
author | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2009-01-05 23:40:10 +0000 |
---|---|---|
committer | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2009-01-05 23:40:10 +0000 |
commit | 85f173cd5b12d5a53a94a2616c498cdae68fec2a (patch) | |
tree | 655dbc4dcb7e2950bde6492c66e2572d53873c6e /src/demuxers/demux_realaudio.c | |
parent | 92d532f070f578c4f7f0df3daadf05497be1ed10 (diff) | |
parent | 5347abe5764b0a0ff3ef1d357ce9934a425758fa (diff) | |
download | xine-lib-85f173cd5b12d5a53a94a2616c498cdae68fec2a.tar.gz xine-lib-85f173cd5b12d5a53a94a2616c498cdae68fec2a.tar.bz2 |
Merge security fixes from 1.1.
--HG--
rename : src/demuxers/demux_nsf.c => src/combined/nsf_demuxer.c
rename : src/demuxers/demux_ogg.c => src/combined/xine_ogg_demuxer.c
rename : src/libsputext/demux_sputext.c => src/spu_dec/sputext_demuxer.c
Diffstat (limited to 'src/demuxers/demux_realaudio.c')
-rw-r--r-- | src/demuxers/demux_realaudio.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/demuxers/demux_realaudio.c b/src/demuxers/demux_realaudio.c index 75c20d61f..4d04f0b90 100644 --- a/src/demuxers/demux_realaudio.c +++ b/src/demuxers/demux_realaudio.c @@ -202,11 +202,19 @@ static int open_ra_file(demux_ra_t *this) { this->h = _X_BE_16 (this->header+40); this->cfs = _X_BE_32 (this->header+24); - this->frame_len = this->w * this->h; - this->frame_size = this->frame_len * sps; - - this->frame_buffer = calloc(this->frame_size, 1); - _x_assert(this->frame_buffer != NULL); + if (this->w < 0x8000 && this->h < 0x8000) { + uint64_t fs; + this->frame_len = this->w * this->h; + fs = (uint64_t) this->frame_len * sps; + if (fs < 0x80000000) { + this->frame_size = fs; + this->frame_buffer = calloc(this->frame_size, 1); + } + } + if (! this->frame_buffer) { + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_realaudio: malloc failed\n"); + return 0; + } if (this->audio_type == BUF_AUDIO_28_8 || this->audio_type == BUF_AUDIO_SIPRO) this->block_align = this->cfs; |