summaryrefslogtreecommitdiff
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2003-09-10 08:20:14 +0000
committerMichael Niedermayer <michaelni@gmx.at>2003-09-10 08:20:14 +0000
commit09770af869dad68cff635256e7ff2e2596552efa (patch)
treef0d83c633690865366211b85c1a9d4f290f79559 /libavcodec/utils.c
parentd9d8910bf280784e58beaf1b7a0f96497502e018 (diff)
detect avcodec_open() on an already opened AVCodecContext
Originally committed as revision 2251 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c3
1 files changed, 3 insertions, 0 deletions
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;