Mercurial > libavcodec.hg
comparison utils.c @ 11585:aea1b01ff81b libavcodec
Fix segfault when encoder initialization fails.
Patch by Craig Thomasson $(name) dot $(surname) ripcode com
author | benoit |
---|---|
date | Tue, 06 Apr 2010 09:52:41 +0000 |
parents | 1025297f5624 |
children | 251ce43203f6 |
comparison
equal
deleted
inserted
replaced
11584:3309ebc37b11 | 11585:aea1b01ff81b |
---|---|
708 avcodec_thread_free(avctx); | 708 avcodec_thread_free(avctx); |
709 if (avctx->codec && avctx->codec->close) | 709 if (avctx->codec && avctx->codec->close) |
710 avctx->codec->close(avctx); | 710 avctx->codec->close(avctx); |
711 avcodec_default_free_buffers(avctx); | 711 avcodec_default_free_buffers(avctx); |
712 av_freep(&avctx->priv_data); | 712 av_freep(&avctx->priv_data); |
713 if(avctx->codec->encode) | 713 if(avctx->codec && avctx->codec->encode) |
714 av_freep(&avctx->extradata); | 714 av_freep(&avctx->extradata); |
715 avctx->codec = NULL; | 715 avctx->codec = NULL; |
716 entangled_thread_counter--; | 716 entangled_thread_counter--; |
717 | 717 |
718 /* Release any user-supplied mutex. */ | 718 /* Release any user-supplied mutex. */ |