summaryrefslogtreecommitdiff
path: root/libavformat/avienc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/avienc.c')
-rw-r--r--libavformat/avienc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libavformat/avienc.c b/libavformat/avienc.c
index 61af511350..e109269fa3 100644
--- a/libavformat/avienc.c
+++ b/libavformat/avienc.c
@@ -85,8 +85,8 @@ static int64_t avi_start_new_riff(AVFormatContext *s, AVIOContext *pb,
static char* avi_stream2fourcc(char* tag, int index, enum AVMediaType type)
{
- tag[0] = '0';
- tag[1] = '0' + index;
+ tag[0] = '0' + index/10;
+ tag[1] = '0' + index%10;
if (type == AVMEDIA_TYPE_VIDEO) {
tag[2] = 'd';
tag[3] = 'c';
@@ -158,6 +158,12 @@ static int avi_write_header(AVFormatContext *s)
int64_t list1, list2, strh, strf;
AVMetadataTag *t = NULL;
+ if (s->nb_streams > AVI_MAX_STREAM_COUNT) {
+ av_log(s, AV_LOG_ERROR, "AVI does not support >%d streams\n",
+ AVI_MAX_STREAM_COUNT);
+ return -1;
+ }
+
for(n=0;n<s->nb_streams;n++) {
s->streams[n]->priv_data= av_mallocz(sizeof(AVIStream));
if(!s->streams[n]->priv_data)