[FFmpeg-cvslog] avformat/mxfdec: only call mxf_free_metadataset when ctx_size is != 0, otherwise ctx == mxf

Baptiste Coudurier git at videolan.org
Thu Jul 19 18:28:17 EEST 2018


ffmpeg | branch: master | Baptiste Coudurier <baptiste.coudurier at gmail.com> | Fri Jul  6 12:06:26 2018 -0700| [b420fead53b1788dfa704a4bf4643a4a0787bb1d] | committer: Baptiste Coudurier

avformat/mxfdec: only call mxf_free_metadataset when ctx_size is != 0, otherwise ctx == mxf

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b420fead53b1788dfa704a4bf4643a4a0787bb1d
---

 libavformat/mxfdec.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 996969d1ff..8d3e8ed4db 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -2631,7 +2631,8 @@ static int mxf_read_local_tags(MXFContext *mxf, KLVPacket *klv, MXFMetadataReadF
         if (ctx_size && tag == 0x3C0A) {
             avio_read(pb, ctx->uid, 16);
         } else if ((ret = read_child(ctx, pb, tag, size, uid, -1)) < 0) {
-            mxf_free_metadataset(&ctx, !!ctx_size);
+            if (ctx_size)
+                mxf_free_metadataset(&ctx, 1);
             return ret;
         }
 
@@ -2640,7 +2641,7 @@ static int mxf_read_local_tags(MXFContext *mxf, KLVPacket *klv, MXFMetadataReadF
         if (avio_tell(pb) > klv_end) {
             if (ctx_size) {
                 ctx->type = type;
-                mxf_free_metadataset(&ctx, !!ctx_size);
+                mxf_free_metadataset(&ctx, 1);
             }
 
             av_log(mxf->fc, AV_LOG_ERROR,



More information about the ffmpeg-cvslog mailing list