X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Frtpdec_latm.c;h=104a00af18927774d809cc0e90e2c40ffaa63d09;hb=f4df5039a791a56de85c64e6b9e4448a221b5c40;hp=9087d6bec540be8c5c6aa21f131cb58ed03ba21e;hpb=79025da3f2e7ab047c8f3c0c817952a98480b26b;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++)