Revision 824535e3

View differences:

libavformat/rtpdec.c
538 538
                                    char *attr, char *value))
539 539
{
540 540
    char attr[256];
541
    char value[4096];
541
    char *value;
542 542
    int res;
543
    int value_size = strlen(p) + 1;
544

  
545
    if (!(value = av_malloc(value_size))) {
546
        av_log(stream, AV_LOG_ERROR, "Failed to allocate data for FMTP.");
547
        return AVERROR(ENOMEM);
548
    }
543 549

  
544 550
    // remove protocol identifier
545 551
    while (*p && *p == ' ') p++; // strip spaces
......
548 554

  
549 555
    while (ff_rtsp_next_attr_and_value(&p,
550 556
                                       attr, sizeof(attr),
551
                                       value, sizeof(value))) {
557
                                       value, value_size)) {
552 558

  
553 559
        res = parse_fmtp(stream, data, attr, value);
554
        if (res < 0)
560
        if (res < 0 && res != AVERROR_PATCHWELCOME) {
561
            av_free(value);
555 562
            return res;
563
        }
556 564
    }
565
    av_free(value);
557 566
    return 0;
558 567
}

Also available in: Unified diff