From 09770af869dad68cff635256e7ff2e2596552efa Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 10 Sep 2003 08:20:14 +0000 Subject: [PATCH] detect avcodec_open() on an already opened AVCodecContext Originally committed as revision 2251 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/utils.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index f441ca2a84..050f26e7b8 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -305,6 +305,9 @@ int avcodec_open(AVCodecContext *avctx, AVCodec *codec) { int ret; + if(avctx->codec) + return -1; + avctx->codec = codec; avctx->codec_id = codec->id; avctx->frame_number = 0;