Browse Source

aiffdec:Rewrite get_meta()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n0.8
Michael Niedermayer 14 years ago
parent
commit
a565c7b7f2
1 changed files with 12 additions and 11 deletions
  1. +12
    -11
      libavformat/aiffdec.c

+ 12
- 11
libavformat/aiffdec.c View File

@@ -68,19 +68,20 @@ static int get_tag(AVIOContext *pb, uint32_t * tag)
static void get_meta(AVFormatContext *s, const char *key, int size)
{
uint8_t *str = av_malloc(size+1);
int res;

if (!str) {
avio_skip(s->pb, size);
return;
}

res = avio_read(s->pb, str, size);
if (res < 0)
return;
if (str) {
int res = avio_read(s->pb, str, size);
if (res < 0){
av_free(str);
return;
}
size += (size&1)-res;
str[res] = 0;
av_metadata_set2(&s->metadata, key, str, AV_METADATA_DONT_STRDUP_VAL);
}else
size+= size&1;

str[res] = 0;
av_metadata_set2(&s->metadata, key, str, AV_METADATA_DONT_STRDUP_VAL);
avio_skip(s->pb, size);
}

/* Returns the number of sound data frames or negative on error */


Loading…
Cancel
Save