aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDale Curtis <dalecurtis@chromium.org>2020-05-18 15:35:35 -0700
committerMichael Niedermayer <michael@niedermayer.cc>2020-05-20 15:47:22 +0200
commitcd0771c38c06ef397466123c6c85521835f98bfd (patch)
treeab134781f6359f3f652c3cf52cf93c274e441fe5
parent5a5d6e052adc8707d24cc26e66c6bb9d9293b27c (diff)
downloadffmpeg-cd0771c38c06ef397466123c6c85521835f98bfd.tar.gz
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 <dalecurtis@chromium.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/mov.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 6490022b1d..e11c9f4457 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;
}