]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rtpdec_mpeg4.c
avformat/nutenc: Write size into right dynamic buffer
[ffmpeg] / libavformat / rtpdec_mpeg4.c
index 08e5b982c1099e597737f13187a98a487bbf8bcf..34c7950bcc501ac87b019aefd9dea902e2d36202 100644 (file)
@@ -112,10 +112,10 @@ static void close_context(PayloadContext *data)
 static int parse_fmtp_config(AVCodecParameters *par, const char *value)
 {
     /* decode the hexa encoded parameter */
-    int len = ff_hex_to_data(NULL, value);
-    av_freep(&par->extradata);
-    if (ff_alloc_extradata(par, len))
-        return AVERROR(ENOMEM);
+    int len = ff_hex_to_data(NULL, value), ret;
+
+    if ((ret = ff_alloc_extradata(par, len)) < 0)
+        return ret;
     ff_hex_to_data(par->extradata, value);
     return 0;
 }