Changeset 263 for trunk/libavformat/asf.c
- Timestamp:
- Nov 20, 2006, 9:45:29 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/libavformat/asf.c ¶
r261 r263 23 23 #include "mpegaudio.h" 24 24 #include "asf.h" 25 #include "common.h" 25 26 26 27 #undef NDEBUG … … 108 109 static void get_str16_nolen(ByteIOContext *pb, int len, char *buf, int buf_size) 109 110 { 110 int c; 111 char *q; 112 113 q = buf; 114 while (len > 0) { 115 c = get_le16(pb); 116 if ((q - buf) < buf_size - 1) 117 *q++ = c; 118 len-=2; 111 char* q = buf; 112 len /= 2; 113 while (len--) { 114 uint8_t tmp; 115 PUT_UTF8(get_le16(pb), tmp, if (q - buf < buf_size - 1) *q++ = tmp;) 119 116 } 120 117 *q = '\0'; … … 362 359 363 360 name_len = get_le16(pb); 364 name = (char *)av_malloc z(name_len);365 get_str16_nolen(pb, name_len, name, name_len );361 name = (char *)av_malloc(name_len * 2); 362 get_str16_nolen(pb, name_len, name, name_len * 2); 366 363 value_type = get_le16(pb); 367 364 value_len = get_le16(pb); 368 365 if ((value_type == 0) || (value_type == 1)) // unicode or byte 369 366 { 370 value = (char *)av_mallocz(value_len); 371 get_str16_nolen(pb, value_len, value, value_len); 367 value = (char *)av_malloc(value_len * 2); 368 get_str16_nolen(pb, value_len, value, 369 value_len * 2); 372 370 if (strcmp(name,"WM/AlbumTitle")==0) { pstrcpy(s->album, sizeof(s->album), value); } 373 371 av_free(value);
Note:
See TracChangeset
for help on using the changeset viewer.