Mercurial > libavcodec.hg
comparison utils.c @ 6069:3670c9e7ff4d libavcodec
Check for avcodec_open codec parameter == NULL and return error in that case
author | reimar |
---|---|
date | Tue, 25 Dec 2007 15:36:12 +0000 |
parents | 2f9c17454842 |
children | 75804d49f33b |
comparison
equal
deleted
inserted
replaced
6068:333b8024c6b2 | 6069:3670c9e7ff4d |
---|---|
846 if(entangled_thread_counter != 1){ | 846 if(entangled_thread_counter != 1){ |
847 av_log(avctx, AV_LOG_ERROR, "insufficient thread locking around avcodec_open/close()\n"); | 847 av_log(avctx, AV_LOG_ERROR, "insufficient thread locking around avcodec_open/close()\n"); |
848 goto end; | 848 goto end; |
849 } | 849 } |
850 | 850 |
851 if(avctx->codec) | 851 if(avctx->codec || !codec) |
852 goto end; | 852 goto end; |
853 | 853 |
854 if (codec->priv_data_size > 0) { | 854 if (codec->priv_data_size > 0) { |
855 avctx->priv_data = av_mallocz(codec->priv_data_size); | 855 avctx->priv_data = av_mallocz(codec->priv_data_size); |
856 if (!avctx->priv_data) { | 856 if (!avctx->priv_data) { |