diff --git a/src/driver/netfile.cpp b/src/driver/netfile.cpp index 1c7e86ce9..db3de6668 100644 --- a/src/driver/netfile.cpp +++ b/src/driver/netfile.cpp @@ -765,7 +765,7 @@ FILE *f_open(const char *filename, const char *acctype) URL url; FILE *fd; int /*i,*/ compatibility_mode = 0; - char *ptr = NULL, buf[4096], type[10]; + char *ptr = NULL, buf[4096] = {0}, type[10] = {0}; if(acctype) strcpy(type, acctype); @@ -1776,16 +1776,17 @@ STREAM_FILTER *ShoutCAST_InitFilter(int meta_int) void ShoutCAST_MetaFilter(STREAM_FILTER *arg) { + + /* bug trap */ + if(!arg) + return; + FILTERDATA *filterdata = (FILTERDATA*)arg->user; int meta_int = filterdata->meta_int; int len = *arg->len; char*buf = (char*)arg->buf; int meta_start; - /* bug trap */ - if(!arg) - return; - #if 0 dprintf(stderr, "filter : cnt : %d\n", filterdata->cnt); dprintf(stderr, "filter : len : %d\n", filterdata->len); diff --git a/src/driver/pictureviewer/bmp.cpp b/src/driver/pictureviewer/bmp.cpp index 4c707462d..a666aa7bf 100644 --- a/src/driver/pictureviewer/bmp.cpp +++ b/src/driver/pictureviewer/bmp.cpp @@ -190,6 +190,7 @@ int fh_bmp_load(const char *name,unsigned char **buffer,int* xp,int* yp) if(tbuffer==NULL) { printf("Error: malloc\n"); + close(fd); return (FH_ERROR_MALLOC); } for (i=0; i