diff options
author | Dale Curtis <dalecurtis@chromium.org> | 2020-05-18 15:35:35 -0700 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-05-20 19:42:47 +0200 |
commit | 7c01f2770131f3e80d1e365f334c26b908178ad4 (patch) | |
tree | 2398c4e57446601f534814f1f31f2855603c2b66 /libavformat | |
parent | 0a4e978f35dd78668cf525be61e3b26a354db769 (diff) | |
download | ffmpeg-7c01f2770131f3e80d1e365f334c26b908178ad4.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>
(cherry picked from commit cd0771c38c06ef397466123c6c85521835f98bfd)
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mov.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index e57e7444a6..6b0e101af9 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2875,6 +2875,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; } |