From: Dale Curtis Date: Mon, 18 May 2020 22:35:35 +0000 (-0700) Subject: avformat/mov: Free temp buffer upon negative sample_size error. X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=cd0771c38c06ef397466123c6c85521835f98bfd;p=ffmpeg avformat/mov: Free temp buffer upon negative sample_size error. 2d8d554f15a7a27cfeca81467cc9341a86f784e2 added a new error condition to mov_read_stsz() but forgot to free a temporary buffer when it occurs. Signed-off-by: Dale Curtis Signed-off-by: Michael Niedermayer --- diff --git a/libavformat/mov.c b/libavformat/mov.c index 6490022b1d1..e11c9f4457f 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2886,6 +2886,7 @@ static int mov_read_stsz(MOVContext *c, AVIOContext *pb, MOVAtom atom) for (i = 0; i < entries && !pb->eof_reached; i++) { sc->sample_sizes[i] = get_bits_long(&gb, field_size); if (sc->sample_sizes[i] < 0) { + av_free(buf); av_log(c->fc, AV_LOG_ERROR, "Invalid sample size %d\n", sc->sample_sizes[i]); return AVERROR_INVALIDDATA; }