pre-c99 compatibility
authorMåns Rullgård <mans@mansr.com>
Sat, 9 Apr 2005 23:27:48 +0000 (23:27 +0000)
committerMåns Rullgård <mans@mansr.com>
Sat, 9 Apr 2005 23:27:48 +0000 (23:27 +0000)
Originally committed as revision 4116 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/ogg2.c
libavformat/ogg2.h

index c54b2a0..065d3bc 100644 (file)
@@ -80,7 +80,7 @@ ogg_save (AVFormatContext * s)
 {
     ogg_t *ogg = s->priv_data;
     ogg_state_t *ost =
-        av_malloc(sizeof (*ost) + ogg->nstreams * sizeof (*ogg->streams));
+        av_malloc(sizeof (*ost) + (ogg->nstreams-1) * sizeof (*ogg->streams));
     int i;
     ost->pos = url_ftell (&s->pb);;
     ost->curidx = ogg->curidx;
index b1146e3..f397a57 100644 (file)
@@ -55,7 +55,7 @@ typedef struct ogg_state {
     uint64_t pos;
     int curidx;
     struct ogg_state *next;
-    ogg_stream_t streams[];
+    ogg_stream_t streams[1];
 } ogg_state_t;
 
 typedef struct ogg {