# HG changeset patch # User reimar # Date 1200149771 0 # Node ID a9e6d0744fc44990f77be9f80d82df3caa7f00aa # Parent 895fe730fa52fa975983f6c3cdf96e685c5c4c51 Avoid uselessly global variables diff -r 895fe730fa52 -r a9e6d0744fc4 libmpcodecs/vd_ijpg.c --- a/libmpcodecs/vd_ijpg.c Sat Jan 12 14:48:12 2008 +0000 +++ b/libmpcodecs/vd_ijpg.c Sat Jan 12 14:56:11 2008 +0000 @@ -117,18 +117,20 @@ longjmp(myerr->setjmp_buffer, 1); } -static struct jpeg_decompress_struct cinfo; -static struct my_error_mgr jerr; static int row_stride; static unsigned char *temp_row=NULL; // decode a frame static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ + struct jpeg_decompress_struct cinfo; + struct my_error_mgr jerr; mp_image_t * mpi = NULL; int width,height,depth,i; if ( len <= 0 ) return NULL; // skipped frame + memset(&cinfo, 0, sizeof(cinfo)); + memset(&jerr, 0, sizeof(jerr)); cinfo.err=jpeg_std_error( &jerr.pub ); jerr.pub.error_exit=my_error_exit; if( setjmp( jerr.setjmp_buffer ) )