On Sun, Jun 07, 2020 at 10:21:56PM +0200, Andreas Rheinhardt wrote: > Michael Niedermayer: > > 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 > > Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc> > > --- > > libavformat/4xm.c | 8 +++++--- > > 1 file 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; > > > LGTM.
will apply thx > (Alternatively, one could av_freep header immediately after the loop > before the second occurrence of GET_LIST_HEADER.) [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Awnsering whenever a program halts or runs forever is On a turing machine, in general impossible (turings halting problem). On any real computer, always possible as a real computer has a finite number of states N, and will either halt in less than N cycles or never halt.
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".