summaryrefslogtreecommitdiff
path: root/libavformat/4xm.c
diff options
context:
space:
mode:
authorJun Zhao <barryjzhao@tencent.com>2019-09-23 10:50:21 +0800
committerJun Zhao <barryjzhao@tencent.com>2019-09-25 11:23:03 +0800
commit5f13859873a45424a345186e8b9913a8c4cb834f (patch)
tree9ab02de2958bdf2747db6731651704d340eb5b8d /libavformat/4xm.c
parent85e338ab0da63cc9f319d657ee2eefe4d6f32094 (diff)
downloadffmpeg-5f13859873a45424a345186e8b9913a8c4cb834f.tar.gz
lavf/4xm: fix memory leak in error handing path
need to free the header in error path. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
Diffstat (limited to 'libavformat/4xm.c')
-rw-r--r--libavformat/4xm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/4xm.c b/libavformat/4xm.c
index a984fc9fdf..a6101a92ec 100644
--- a/libavformat/4xm.c
+++ b/libavformat/4xm.c
@@ -241,7 +241,8 @@ static int fourxm_read_header(AVFormatContext *s)
size = AV_RL32(&header[i + 4]);
if (size > header_size - i - 8 && (fourcc_tag == vtrk_TAG || fourcc_tag == strk_TAG)) {
av_log(s, AV_LOG_ERROR, "chunk larger than array %d>%d\n", size, header_size - i - 8);
- return AVERROR_INVALIDDATA;
+ ret = AVERROR_INVALIDDATA;
+ goto fail;
}
if (fourcc_tag == std__TAG) {