http://bugs.gentoo.org/show_bug.cgi?id=297579 --- src/mms.c +++ src/mms.c @@ -1021,10 +1021,15 @@ /* forces the asf demuxer to not choose this stream */ if (this->streams[i].bitrate_pos) { - this->asf_header[this->streams[i].bitrate_pos ] = 0; - this->asf_header[this->streams[i].bitrate_pos + 1] = 0; - this->asf_header[this->streams[i].bitrate_pos + 2] = 0; - this->asf_header[this->streams[i].bitrate_pos + 3] = 0; + if (this->streams[i].bitrate_pos+3 <= ASF_HEADER_LEN) { + this->asf_header[this->streams[i].bitrate_pos ] = 0; + this->asf_header[this->streams[i].bitrate_pos + 1] = 0; + this->asf_header[this->streams[i].bitrate_pos + 2] = 0; + this->asf_header[this->streams[i].bitrate_pos + 3] = 0; + } else { + lprintf("***LOG:*** -- " + "libmms: attempt to write beyond asf header limit"); + } } } }