summaryrefslogtreecommitdiff
path: root/libavformat/mms.c
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2010-10-04 19:45:12 +0000
committerAurelien Jacobs <aurel@gnuage.org>2010-10-04 19:45:12 +0000
commit0f02a7e2d25d3324e10d3e14b02b70ef9285b9bb (patch)
treef07e14c493840a4baed630feaddc90d0ad28689f /libavformat/mms.c
parent00e962a27576cb8169a392c81a9a4252a5791abc (diff)
downloadffmpeg-0f02a7e2d25d3324e10d3e14b02b70ef9285b9bb.tar.gz
mms: remove dependency on MAX_STREAM API
Originally committed as revision 25335 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mms.c')
-rw-r--r--libavformat/mms.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libavformat/mms.c b/libavformat/mms.c
index 73f4e6b671..d995a43a0e 100644
--- a/libavformat/mms.c
+++ b/libavformat/mms.c
@@ -24,6 +24,12 @@
#include "asf.h"
#include "libavutil/intreadwrite.h"
+#if FF_API_MAX_STREAMS
+#define MMS_MAX_STREAMS MAX_STREAMS
+#else
+#define MMS_MAX_STREAMS 256 /**< arbitrary sanity check value */
+#endif
+
int ff_mms_read_header(MMSContext *mms, uint8_t *buf, const int size)
{
char *pos;
@@ -97,7 +103,7 @@ int ff_mms_asf_header_parser(MMSContext *mms)
//The second condition is for checking CS_PKT_STREAM_ID_REQUEST packet size,
//we can calcuate the packet size by stream_num.
//Please see function send_stream_selection_request().
- if (mms->stream_num < MAX_STREAMS &&
+ if (mms->stream_num < MMS_MAX_STREAMS &&
46 + mms->stream_num * 6 < sizeof(mms->out_buffer)) {
mms->streams = av_fast_realloc(mms->streams,
&mms->nb_streams_allocated,