changeset 664:76d0af843707 libavformat

don't crash on null codec; by matthieu castet <castet DOT matthieu AT free DOT fr>
author mmu_man
date Fri, 28 Jan 2005 11:19:47 +0000
parents 570274d13064
children 47d5b20c9aba
files movenc.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/movenc.c	Fri Jan 28 08:08:42 2005 +0000
+++ b/movenc.c	Fri Jan 28 11:19:47 2005 +0000
@@ -515,9 +515,9 @@
     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 */