aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-04-08 01:49:53 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-04-08 11:57:07 +0200
commitc72fca598c90c8550fe51e967ea54dae7f8cbc78 (patch)
treeccbf5a08eb67626564fb41a73f36ae499d7f2e0f
parentb0997b8526e5f801052dbfcef89fa9d77fd046f4 (diff)
downloadffmpeg-c72fca598c90c8550fe51e967ea54dae7f8cbc78.tar.gz
avcodec/vc1dec: Fix memleak upon allocation error
ff_vc1_decode_init_alloc_tables() had one error path that forgot to free already allocated buffers; these would then be overwritten on the next allocation attempt (or they would just not be freed in case this happened during init, as the decoders for which it is used do not have the FF_CODEC_CAP_INIT_CLEANUP set). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> (cherry picked from commit 98060a198ef0bd213d0d0b029f8955fcd3be93d2)
-rw-r--r--libavcodec/vc1dec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index b702b76060..ea93e11588 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -384,7 +384,7 @@ av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v)
if (s->avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || s->avctx->codec_id == AV_CODEC_ID_VC1IMAGE) {
for (i = 0; i < 4; i++)
if (!(v->sr_rows[i >> 1][i & 1] = av_malloc(v->output_width)))
- return AVERROR(ENOMEM);
+ goto error;
}
ret = ff_intrax8_common_init(s->avctx, &v->x8, &s->idsp,