* commit 'f91d94bdfc3f5f83ff0be4d19d10d0a35697386f': vc1dec: Properly call deinit function on error
Unified · Split
| @@ -373,20 +373,14 @@ av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v) · 372 unmodified lines | ||
| 373 | 373 | if (!v->mv_type_mb_plane || !v->direct_mb_plane || !v->acpred_plane || !v->over_flags_plane || |
| 374 | 374 | !v->block || !v->cbp_base || !v->ttblk_base || !v->is_intra_base || !v->luma_mv_base || |
| 375 | 375 | !v->mb_type_base) { |
| 376 | − av_freep(&v->mv_type_mb_plane); | |
| 377 | − av_freep(&v->direct_mb_plane); | |
| 378 | − av_freep(&v->acpred_plane); | |
| 379 | − av_freep(&v->over_flags_plane); | |
| 380 | − av_freep(&v->block); | |
| 381 | − av_freep(&v->cbp_base); | |
| 382 | − av_freep(&v->ttblk_base); | |
| 383 | − av_freep(&v->is_intra_base); | |
| 384 | − av_freep(&v->luma_mv_base); | |
| 385 | − av_freep(&v->mb_type_base); | |
| 386 | − return AVERROR(ENOMEM); | |
| 376 | + goto error; | |
| 387 | 377 | } |
| 388 | 378 | |
| 389 | 379 | return 0; |
| 380 | + | |
| 381 | +error: | |
| 382 | + ff_vc1_decode_end(s->avctx); | |
| 383 | + return AVERROR(ENOMEM); | |
| 390 | 384 | } |
| 391 | 385 | |
| 392 | 386 | av_cold void ff_vc1_init_transposed_scantables(VC1Context *v) |