Drew Perttula - 2005-11-13

Logged In: YES
user_id=127598

This happens because Codec_New might run CodecClose before
setting the cCodec. Here is a patch which lets Codec_New
fail with an exception instead of a crash:

Index: video/vcodec/vcodec.c

RCS file: /cvsroot/pymedia/pymedia/video/vcodec/vcodec.c,v
retrieving revision 1.11
diff -r1.11 vcodec.c
1204,1205c1204,1207
< avcodec_close(obj->cCodec);
< av_free( obj->cCodec );
---
> if (obj->cCodec) {
> avcodec_close(obj->cCodec);
> av_free( obj->cCodec );
> }
1221a1224
> codec->cCodec = NULL;