History

vc1dec: Properly call deinit function on error

Vittorio Giovara committed 10 years ago

Commit f91d94b1 parent 35b1cd31 file · +5 −11Browse files

Unified · Split

libavcodec/vc1dec.c+5−11
@@ -362,20 +362,14 @@ av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v) · 361 unmodified lines
362362 if (!v->mv_type_mb_plane || !v->direct_mb_plane || !v->acpred_plane || !v->over_flags_plane ||
363363 !v->block || !v->cbp_base || !v->ttblk_base || !v->is_intra_base || !v->luma_mv_base ||
364364 !v->mb_type_base) {
365− av_freep(&v->mv_type_mb_plane);
366− av_freep(&v->direct_mb_plane);
367− av_freep(&v->acpred_plane);
368− av_freep(&v->over_flags_plane);
369− av_freep(&v->block);
370− av_freep(&v->cbp_base);
371− av_freep(&v->ttblk_base);
372− av_freep(&v->is_intra_base);
373− av_freep(&v->luma_mv_base);
374− av_freep(&v->mb_type_base);
375− return AVERROR(ENOMEM);
365+ goto error;
376366 }
377367
378368 return 0;
369+
370+error:
371+ ff_vc1_decode_end(s->avctx);
372+ return AVERROR(ENOMEM);
379373 }
380374
381375 av_cold void ff_vc1_init_transposed_scantables(VC1Context *v)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t