diff options
author | François Revol <revol@free.fr> | 2005-01-28 12:13:53 +0000 |
---|---|---|
committer | François Revol <revol@free.fr> | 2005-01-28 12:13:53 +0000 |
commit | 0c716ab71def55108294c1a819403be11f96a314 (patch) | |
tree | 06f076dd87fda255bff5f9f32854f943a877debc /libavformat/movenc.c | |
parent | 7d8b13b46b17ee199a302adf84c460c77fe7ff12 (diff) | |
download | ffmpeg-0c716ab71def55108294c1a819403be11f96a314.tar.gz |
fix segfault by matthieu castet <castet DOT matthieu AT free DOT fr>
Originally committed as revision 3896 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r-- | libavformat/movenc.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 914010c6a1..5e4fe50330 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -1227,9 +1227,8 @@ int mov_write_ftyp_tag(ByteIOContext *pb, AVFormatContext *s) return 0x14; } -int mov_write_uuidprof_tag(ByteIOContext *pb, AVFormatContext *s) +static void mov_write_uuidprof_tag(ByteIOContext *pb, AVFormatContext *s) { - MOVContext *mov = s->priv_data; int AudioRate = s->streams[1]->codec.sample_rate; int FrameRate = ((s->streams[0]->codec.frame_rate) * (0x10000))/ (s->streams[0]->codec.frame_rate_base); @@ -1279,8 +1278,6 @@ int mov_write_uuidprof_tag(ByteIOContext *pb, AVFormatContext *s) put_be16(pb, s->streams[0]->codec.width); put_be16(pb, s->streams[0]->codec.height); put_be32(pb, 0x010001 ); - - return 0x94; } static int mov_write_header(AVFormatContext *s) @@ -1319,8 +1316,13 @@ static int mov_write_header(AVFormatContext *s) if ( mov->mode == MODE_3GP || mov->mode == MODE_MP4 || mov->mode == MODE_PSP ) mov_write_ftyp_tag(pb,s); - if ( mov->mode == MODE_PSP ) + if ( mov->mode == MODE_PSP ) { + if ( s->nb_streams != 2 ) { + av_log(s, AV_LOG_ERROR, "PSP mode need one video and one audio stream\n"); + return -1; + } mov_write_uuidprof_tag(pb,s); + } } for (i=0; i<MAX_STREAMS; i++) { |