# HG changeset patch # User mstorsjo # Date 1277756845 0 # Node ID da9998b48dffecba950888128a965eaf23782903 # Parent b93d7a25cd6b1a741b897ea485e649a3a3aa55a1 rtpdec: Malloc the fmtp value buffer This allows very large value strings, needed for xiph extradata. Patch by Josh Allmann, joshua dot allmann at gmail diff -r b93d7a25cd6b -r da9998b48dff rtpdec.c --- a/rtpdec.c Mon Jun 28 11:35:18 2010 +0000 +++ b/rtpdec.c Mon Jun 28 20:27:25 2010 +0000 @@ -538,8 +538,14 @@ char *attr, char *value)) { char attr[256]; - char value[4096]; + char *value; int res; + int value_size = strlen(p) + 1; + + if (!(value = av_malloc(value_size))) { + av_log(stream, AV_LOG_ERROR, "Failed to allocate data for FMTP."); + return AVERROR(ENOMEM); + } // remove protocol identifier while (*p && *p == ' ') p++; // strip spaces @@ -548,11 +554,14 @@ while (ff_rtsp_next_attr_and_value(&p, attr, sizeof(attr), - value, sizeof(value))) { + value, value_size)) { res = parse_fmtp(stream, data, attr, value); - if (res < 0) + if (res < 0 && res != AVERROR_PATCHWELCOME) { + av_free(value); return res; + } } + av_free(value); return 0; }