Commit 32635be2 authored by bcoudurier's avatar bcoudurier

use strlen and do not write useless trailing 0 according to specs

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@15057 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 5abd3ff5
...@@ -329,7 +329,7 @@ static void mxf_write_preface(AVFormatContext *s) ...@@ -329,7 +329,7 @@ static void mxf_write_preface(AVFormatContext *s)
*/ */
static void mxf_write_utf16(ByteIOContext *pb, const char *value) static void mxf_write_utf16(ByteIOContext *pb, const char *value)
{ {
int i, size = strlen(value)+1; int i, size = strlen(value);
for (i = 0; i < size; i++) for (i = 0; i < size; i++)
put_be16(pb, value[i]); put_be16(pb, value[i]);
} }
...@@ -341,12 +341,12 @@ static void mxf_write_identification(AVFormatContext *s) ...@@ -341,12 +341,12 @@ static void mxf_write_identification(AVFormatContext *s)
mxf_write_metadata_key(pb, 0x013000); mxf_write_metadata_key(pb, 0x013000);
PRINT_KEY(s, "identification key", pb->buf_ptr - 16); PRINT_KEY(s, "identification key", pb->buf_ptr - 16);
company_name_len = sizeof("FFmpeg") * 2; company_name_len = strlen("FFmpeg") * 2;
product_name_len = sizeof("OP1a Muxer") * 2; product_name_len = strlen("OP1a Muxer") * 2;
length = 80 + company_name_len + product_name_len; length = 80 + company_name_len + product_name_len;
if (!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT)) { if (!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT)) {
version_string_len = sizeof(LIBAVFORMAT_IDENT) * 2; version_string_len = strlen(LIBAVFORMAT_IDENT) * 2;
length += 4 + version_string_len; length += 4 + version_string_len;
} }
klv_encode_ber_length(pb, length); klv_encode_ber_length(pb, length);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment