diff options
author | François Revol <revol@free.fr> | 2005-01-28 11:19:47 +0000 |
---|---|---|
committer | François Revol <revol@free.fr> | 2005-01-28 11:19:47 +0000 |
commit | 25cf9062babc92b1657bf024f872df4b0ffa66a9 (patch) | |
tree | b08d7c64d93daa61c8ed9dfecbc789441a296585 /libavformat/movenc.c | |
parent | 46103f6bbd232da256ca8da145b220a0b386afc9 (diff) | |
download | ffmpeg-25cf9062babc92b1657bf024f872df4b0ffa66a9.tar.gz |
don't crash on null codec; by matthieu castet <castet DOT matthieu AT free DOT fr>
Originally committed as revision 3894 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r-- | libavformat/movenc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 7a1f6ddb28..914010c6a1 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -515,9 +515,9 @@ static int mov_write_video_tag(ByteIOContext *pb, MOVTrack* track) put_be16(pb, 1); /* Frame count (= 1) */ memset(compressor_name,0,32); - if (track->enc->codec->name) + if (track->enc->codec && track->enc->codec->name) strncpy(compressor_name,track->enc->codec->name,31); - put_byte(pb, FFMAX(strlen(compressor_name),32) ); + put_byte(pb, strlen(compressor_name)); put_buffer(pb, compressor_name, 31); put_be16(pb, 0x18); /* Reserved */ |