]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rtpdec_latm.c
avcodec: Constify AVCodecs
[ffmpeg] / libavformat / rtpdec_latm.c
index 9087d6bec540be8c5c6aa21f131cb58ed03ba21e..104a00af18927774d809cc0e90e2c40ffaa63d09 100644 (file)
@@ -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++)