summaryrefslogtreecommitdiff
path: root/libavformat/4xm.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-06-07 21:35:43 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-06-08 12:27:18 +0200
commita5313ce6542a4ee4112acd260e59bff698f3dddd (patch)
tree2835f30169743d70cb6d1302fcaad18160739567 /libavformat/4xm.c
parentb7e18212841ffd698f8f1ef73713209d160d701e (diff)
downloadffmpeg-a5313ce6542a4ee4112acd260e59bff698f3dddd.tar.gz
avformat/4xm: Cleanup on GET_LIST_HEADER() failure
Fixes: memleak Fixes: 23142/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5932860820422656 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/4xm.c')
-rw-r--r--libavformat/4xm.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libavformat/4xm.c b/libavformat/4xm.c
index aea9226984..5f0504b13e 100644
--- a/libavformat/4xm.c
+++ b/libavformat/4xm.c
@@ -59,8 +59,10 @@
#define GET_LIST_HEADER() \
fourcc_tag = avio_rl32(pb); \
size = avio_rl32(pb); \
- if (fourcc_tag != LIST_TAG) \
- return AVERROR_INVALIDDATA; \
+ if (fourcc_tag != LIST_TAG) { \
+ ret = AVERROR_INVALIDDATA; \
+ goto fail; \
+ } \
fourcc_tag = avio_rl32(pb);
typedef struct AudioTrack {
@@ -210,7 +212,7 @@ static int fourxm_read_header(AVFormatContext *s)
unsigned int size;
int header_size;
FourxmDemuxContext *fourxm = s->priv_data;
- unsigned char *header;
+ unsigned char *header = NULL;
int i, ret;
fourxm->track_count = 0;