X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Frtpdec_latm.c;h=104a00af18927774d809cc0e90e2c40ffaa63d09;hb=83b6471dcb762859f20b2c414decc755fcceb5e8;hp=9087d6bec540be8c5c6aa21f131cb58ed03ba21e;hpb=d0c43e32427ec1efac364be0987a6aafa695527f;p=ffmpeg diff --git a/libavformat/rtpdec_latm.c b/libavformat/rtpdec_latm.c index 9087d6bec54..104a00af189 100644 --- a/libavformat/rtpdec_latm.c +++ b/libavformat/rtpdec_latm.c @@ -115,9 +115,8 @@ static int parse_fmtp_config(AVStream *st, const char *value) ret = AVERROR_PATCHWELCOME; goto end; } - av_freep(&st->codecpar->extradata); - if (ff_alloc_extradata(st->codecpar, (get_bits_left(&gb) + 7)/8)) { - ret = AVERROR(ENOMEM); + ret = ff_alloc_extradata(st->codecpar, (get_bits_left(&gb) + 7)/8); + if (ret < 0) { goto end; } for (i = 0; i < st->codecpar->extradata_size; i++)