Commit 19635234 authored by Reimar Döffinger's avatar Reimar Döffinger

Convert latin1 codec_name in mov to UTF-8, since all strings in FFmpeg

must be valid UTF-8.

Originally committed as revision 20092 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 53f9f9c9
...@@ -909,8 +909,13 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom) ...@@ -909,8 +909,13 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
get_buffer(pb, codec_name, 32); /* codec name, pascal string */ get_buffer(pb, codec_name, 32); /* codec name, pascal string */
if (codec_name[0] <= 31) { if (codec_name[0] <= 31) {
memcpy(st->codec->codec_name, &codec_name[1],codec_name[0]); int i;
st->codec->codec_name[codec_name[0]] = 0; int pos = 0;
for (i = 0; i < codec_name[0] && pos < sizeof(st->codec->codec_name) - 3; i++) {
uint8_t tmp;
PUT_UTF8(codec_name[i], tmp, st->codec->codec_name[pos++] = tmp;)
}
st->codec->codec_name[pos] = 0;
} }
st->codec->bits_per_coded_sample = get_be16(pb); /* depth */ st->codec->bits_per_coded_sample = get_be16(pb); /* depth */
......
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