[FFmpeg-cvslog] r20092 - trunk/libavformat/mov.c
reimar
subversion
Wed Sep 30 11:43:57 CEST 2009
Author: reimar
Date: Wed Sep 30 11:43:56 2009
New Revision: 20092
Log:
Convert latin1 codec_name in mov to UTF-8, since all strings in FFmpeg
must be valid UTF-8.
Modified:
trunk/libavformat/mov.c
Modified: trunk/libavformat/mov.c
==============================================================================
--- trunk/libavformat/mov.c Wed Sep 30 07:49:18 2009 (r20091)
+++ trunk/libavformat/mov.c Wed Sep 30 11:43:56 2009 (r20092)
@@ -909,8 +909,13 @@ static int mov_read_stsd(MOVContext *c,
get_buffer(pb, codec_name, 32); /* codec name, pascal string */
if (codec_name[0] <= 31) {
- memcpy(st->codec->codec_name, &codec_name[1],codec_name[0]);
- st->codec->codec_name[codec_name[0]] = 0;
+ int i;
+ 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 */
More information about the ffmpeg-cvslog
mailing list