diff options
author | Baptiste Coudurier | 2018-07-06 12:06:26 -0700 |
---|---|---|
committer | Baptiste Coudurier | 2018-07-19 08:25:24 -0700 |
commit | b420fead53b1788dfa704a4bf4643a4a0787bb1d (patch) | |
tree | ff1846023edd408fa17d9045ec2616e97e7e2b2a | |
parent | 1809f1cda9563ff4451203e0c852afe12f684b80 (diff) |
avformat/mxfdec: only call mxf_free_metadataset when ctx_size is != 0, otherwise ctx == mxf
-rw-r--r-- | libavformat/mxfdec.c | 5 |
1 files 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, |