Revision 12ad6671 libavformat/avidec.c

View differences:

libavformat/avidec.c
230 230
static int avi_read_tag(AVFormatContext *s, const char *key, unsigned int size)
231 231
{
232 232
    ByteIOContext *pb = s->pb;
233
    uint8_t value[1024];
233
    char *value;
234 234

  
235
    int64_t i = url_ftell(pb);
236 235
    size += (size & 1);
237
    get_strz(pb, value, sizeof(value));
238
    url_fseek(pb, i+size, SEEK_SET);
239 236

  
240
    return av_metadata_set(&s->metadata, key, value);
237
    if (size == UINT_MAX)
238
        return -1;
239
    value = av_malloc(size+1);
240
    if (!value)
241
        return -1;
242
    get_strz(pb, value, size);
243

  
244
    return av_metadata_set2(&s->metadata, key, value,
245
                                  AV_METADATA_DONT_STRDUP_VAL);
241 246
}
242 247

  
243 248
static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)

Also available in: Unified diff