aboutsummaryrefslogtreecommitdiffhomepage
path: root/libmpcodecs
diff options
context:
space:
mode:
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/vd_ijpg.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libmpcodecs/vd_ijpg.c b/libmpcodecs/vd_ijpg.c
index cee851b58b..4e0c62d6d4 100644
--- a/libmpcodecs/vd_ijpg.c
+++ b/libmpcodecs/vd_ijpg.c
@@ -117,18 +117,20 @@ METHODDEF(void) my_error_exit (j_common_ptr cinfo)
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 ) )