diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-09-10 08:20:14 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-09-10 08:20:14 +0000 |
commit | 09770af869dad68cff635256e7ff2e2596552efa (patch) | |
tree | f0d83c633690865366211b85c1a9d4f290f79559 /libavcodec/utils.c | |
parent | d9d8910bf280784e58beaf1b7a0f96497502e018 (diff) | |
download | ffmpeg-09770af869dad68cff635256e7ff2e2596552efa.tar.gz |
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.c | 3 |
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; |