comparison asfdec.c @ 4955:6671e7510fca libavformat

fix get_str16_nolen with odd len, fix #1065
author bcoudurier
date Sun, 24 May 2009 10:26:41 +0000
parents 2a4f618b2da3
children 5cf7e033989d
comparison
equal deleted inserted replaced
4954:2a4f618b2da3 4955:6671e7510fca
120 #endif 120 #endif
121 121
122 static void get_str16_nolen(ByteIOContext *pb, int len, char *buf, int buf_size) 122 static void get_str16_nolen(ByteIOContext *pb, int len, char *buf, int buf_size)
123 { 123 {
124 char* q = buf; 124 char* q = buf;
125 len /= 2; 125 for (; len > 1; len -= 2) {
126 while (len--) {
127 uint8_t tmp; 126 uint8_t tmp;
128 PUT_UTF8(get_le16(pb), tmp, if (q - buf < buf_size - 1) *q++ = tmp;) 127 PUT_UTF8(get_le16(pb), tmp, if (q - buf < buf_size - 1) *q++ = tmp;)
129 } 128 }
129 if (len > 0)
130 url_fskip(pb, len);
130 *q = '\0'; 131 *q = '\0';
131 } 132 }
132 133
133 static int asf_probe(AVProbeData *pd) 134 static int asf_probe(AVProbeData *pd)
134 { 135 {