You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
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>
This commit is contained in:
@@ -59,8 +59,10 @@
|
|||||||
#define GET_LIST_HEADER() \
|
#define GET_LIST_HEADER() \
|
||||||
fourcc_tag = avio_rl32(pb); \
|
fourcc_tag = avio_rl32(pb); \
|
||||||
size = avio_rl32(pb); \
|
size = avio_rl32(pb); \
|
||||||
if (fourcc_tag != LIST_TAG) \
|
if (fourcc_tag != LIST_TAG) { \
|
||||||
return AVERROR_INVALIDDATA; \
|
ret = AVERROR_INVALIDDATA; \
|
||||||
|
goto fail; \
|
||||||
|
} \
|
||||||
fourcc_tag = avio_rl32(pb);
|
fourcc_tag = avio_rl32(pb);
|
||||||
|
|
||||||
typedef struct AudioTrack {
|
typedef struct AudioTrack {
|
||||||
@@ -210,7 +212,7 @@ static int fourxm_read_header(AVFormatContext *s)
|
|||||||
unsigned int size;
|
unsigned int size;
|
||||||
int header_size;
|
int header_size;
|
||||||
FourxmDemuxContext *fourxm = s->priv_data;
|
FourxmDemuxContext *fourxm = s->priv_data;
|
||||||
unsigned char *header;
|
unsigned char *header = NULL;
|
||||||
int i, ret;
|
int i, ret;
|
||||||
|
|
||||||
fourxm->track_count = 0;
|
fourxm->track_count = 0;
|
||||||
|
Reference in New Issue
Block a user