Skip to content
Snippets Groups Projects
Commit 01f0e6a0 authored by Vittorio Giovara's avatar Vittorio Giovara
Browse files

vc1dec: Fix leak on error for array allocations

The deinit function in the 'error' section will correctly free
everything.
parent f91d94bd
No related branches found
No related tags found
No related merge requests found
...@@ -355,8 +355,11 @@ av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v) ...@@ -355,8 +355,11 @@ av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v)
ff_intrax8_common_init(&v->x8,s); ff_intrax8_common_init(&v->x8,s);
if (s->avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || s->avctx->codec_id == AV_CODEC_ID_VC1IMAGE) { if (s->avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || s->avctx->codec_id == AV_CODEC_ID_VC1IMAGE) {
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++) {
if (!(v->sr_rows[i >> 1][i & 1] = av_malloc(v->output_width))) return -1; v->sr_rows[i >> 1][i & 1] = av_malloc(v->output_width);
if (!v->sr_rows[i >> 1][i & 1])
goto error;
}
} }
if (!v->mv_type_mb_plane || !v->direct_mb_plane || !v->acpred_plane || !v->over_flags_plane || if (!v->mv_type_mb_plane || !v->direct_mb_plane || !v->acpred_plane || !v->over_flags_plane ||
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment