]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/id3v2.c
libavformat: Use ffio_free_dyn_buf where applicable
[ffmpeg] / libavformat / id3v2.c
index 3c5c06207f60cea989ad14298d6236cc1b01a04a..b8994b2226334c6222eb3dc6d86eed2e811625c4 100644 (file)
@@ -207,8 +207,8 @@ static int decode_str(AVFormatContext *s, AVIOContext *pb, int encoding,
     case ID3v2_ENCODING_UTF16BOM:
         if ((left -= 2) < 0) {
             av_log(s, AV_LOG_ERROR, "Cannot read BOM value, input too short\n");
-            avio_close_dyn_buf(dynbuf, dst);
-            av_freep(dst);
+            ffio_free_dyn_buf(&dynbuf);
+            *dst = NULL;
             return AVERROR_INVALIDDATA;
         }
         switch (avio_rb16(pb)) {
@@ -218,8 +218,8 @@ static int decode_str(AVFormatContext *s, AVIOContext *pb, int encoding,
             break;
         default:
             av_log(s, AV_LOG_ERROR, "Incorrect BOM value\n");
-            avio_close_dyn_buf(dynbuf, dst);
-            av_freep(dst);
+            ffio_free_dyn_buf(&dynbuf);
+            *dst = NULL;
             *maxread = left;
             return AVERROR_INVALIDDATA;
         }