diff options
author | František Dvořák <valtri@users.sourceforge.net> | 2006-04-05 22:12:17 +0000 |
---|---|---|
committer | František Dvořák <valtri@users.sourceforge.net> | 2006-04-05 22:12:17 +0000 |
commit | 639bd610bfcb1a028b91a5c3d125045c8de6d8b7 (patch) | |
tree | 6247df0c3a36b4a8eb11e0a764ff3e99632a619b /src/libw32dll | |
parent | 22924ef0924502e0d9b1652651d40270602ee7a0 (diff) | |
download | xine-lib-639bd610bfcb1a028b91a5c3d125045c8de6d8b7.tar.gz xine-lib-639bd610bfcb1a028b91a5c3d125045c8de6d8b7.tar.bz2 |
1) various warning fixes
2) [coverity] fixes:
- 279 (w32): test should be on input parametr type, not typeW
- 267 (aout): can be ignored but there was warning anyway
- 234 (w32): missing free on error & exit
- 152 (w32): missing free on error & exit
- 148 (w32): fixed bound of static array in test
- 101 (ffdec): defense code when avodec_encode_video will fail (just defense to the future,
should never happen with current ffmpeg in xine)
- 98, 99 (w32): check negative handle by _x_assert (it's used as index to array)
- 90 (w32): negate pointer check (+added check for size)
- 89 (w32): added NULL and size check
CVS patchset: 7959
CVS date: 2006/04/05 22:12:17
Diffstat (limited to 'src/libw32dll')
-rw-r--r-- | src/libw32dll/DirectShow/outputpin.c | 1 | ||||
-rw-r--r-- | src/libw32dll/wine/driver.c | 4 | ||||
-rw-r--r-- | src/libw32dll/wine/ldt_keeper.c | 3 | ||||
-rw-r--r-- | src/libw32dll/wine/pe_resource.c | 2 | ||||
-rw-r--r-- | src/libw32dll/wine/win32.c | 11 |
5 files changed, 13 insertions, 8 deletions
diff --git a/src/libw32dll/DirectShow/outputpin.c b/src/libw32dll/DirectShow/outputpin.c index f971951f3..acff3ac16 100644 --- a/src/libw32dll/DirectShow/outputpin.c +++ b/src/libw32dll/DirectShow/outputpin.c @@ -487,6 +487,7 @@ COutputPin* COutputPinCreate(const AM_MEDIA_TYPE* amt) if (!This->vt || !This->mempin || !ivt) { COutputPin_Destroy(This); + free(ivt); return NULL; } diff --git a/src/libw32dll/wine/driver.c b/src/libw32dll/wine/driver.c index 923622aaa..ef8761628 100644 --- a/src/libw32dll/wine/driver.c +++ b/src/libw32dll/wine/driver.c @@ -168,7 +168,7 @@ HDRVR DrvOpen(LPARAM lParam2) return ((HDRVR) 0); } - TRACE("DriverProc == %X\n", hDriver->DriverProc); + TRACE("DriverProc == %p\n", hDriver->DriverProc); SendDriverMessage((HDRVR)hDriver, DRV_LOAD, 0, 0); TRACE("DRV_LOAD Ok!\n"); SendDriverMessage((HDRVR)hDriver, DRV_ENABLE, 0, 0); @@ -177,7 +177,7 @@ HDRVR DrvOpen(LPARAM lParam2) // open driver and remmeber proper DriverID hDriver->dwDriverID = SendDriverMessage((HDRVR)hDriver, DRV_OPEN, (LPARAM) unknown, lParam2); - TRACE("DRV_OPEN Ok!(%X)\n", hDriver->dwDriverID); + TRACE("DRV_OPEN Ok!(%lX)\n", hDriver->dwDriverID); printf("Loaded DLL driver %s\n", filename); return (HDRVR)hDriver; diff --git a/src/libw32dll/wine/ldt_keeper.c b/src/libw32dll/wine/ldt_keeper.c index 6941dca39..49cdc4e87 100644 --- a/src/libw32dll/wine/ldt_keeper.c +++ b/src/libw32dll/wine/ldt_keeper.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: ldt_keeper.c,v 1.13 2004/09/21 19:35:57 hadess Exp $ + * $Id: ldt_keeper.c,v 1.14 2006/04/05 22:12:21 valtri Exp $ * * * contents: @@ -293,6 +293,7 @@ ldt_fs_t* Setup_LDT_Keeper(void) ldt_fs->fd = open("/dev/zero", O_RDWR); if(ldt_fs->fd<0){ perror( "Cannot open /dev/zero for READ+WRITE. Check permissions! error: "); + free(ldt_fs); return NULL; } diff --git a/src/libw32dll/wine/pe_resource.c b/src/libw32dll/wine/pe_resource.c index 5d7f3d234..2af09f60e 100644 --- a/src/libw32dll/wine/pe_resource.c +++ b/src/libw32dll/wine/pe_resource.c @@ -343,7 +343,7 @@ PE_EnumResourceLanguagesA( else typeW = (LPWSTR)type; resdir = GetResDirEntryW(resdir,typeW,(DWORD)pem->pe_resource,FALSE); - if (HIWORD(typeW)) + if (HIWORD(type)) HeapFree(heap,0,typeW); if (!resdir) return FALSE; diff --git a/src/libw32dll/wine/win32.c b/src/libw32dll/wine/win32.c index 940750b7e..8a3d004a5 100644 --- a/src/libw32dll/wine/win32.c +++ b/src/libw32dll/wine/win32.c @@ -1430,7 +1430,7 @@ static void WINAPI expDeleteCriticalSection(CRITICAL_SECTION *c) static int WINAPI expGetCurrentThreadId() { dbgprintf("GetCurrentThreadId() => %d\n", pthread_self()); - return pthread_self(); + return (int)pthread_self(); } static int WINAPI expGetCurrentProcess() { @@ -1519,7 +1519,7 @@ static int WINAPI expTlsFree(int idx) { int index = (int) idx; dbgprintf("TlsFree(%d)\n",index); - if((index<0) || (index>64)) + if((index<0) || (index>=64)) return 0; tls_use_map[index]=0; return 1; @@ -2619,7 +2619,7 @@ static int WINAPI expEnumWindows(int (*callback_func)(), void *callback_param) static int WINAPI expGetWindowThreadProcessId(HWND win, int *pid_data) { - int tid = pthread_self(); + int tid = (int)pthread_self(); dbgprintf("GetWindowThreadProcessId(0x%x, 0x%x) => %d\n", win, pid_data, tid); if (pid_data) @@ -3131,6 +3131,8 @@ static int WINAPI expGetEnvironmentVariableA(const char* name, char* field, int p = getenv(name); if (p) strncpy(field,p,size); */ + if (!field || size < sizeof("__GLOBAL_HEAP_SELECTED,1")) + return 0; if (strcmp(name,"__MSVCRT_HEAP_SELECT")==0) strcpy(field,"__GLOBAL_HEAP_SELECTED,1"); dbgprintf("GetEnvironmentVariableA(0x%x='%s', 0x%x, %d) => %d\n", name, name, field, size, strlen(field)); @@ -3558,7 +3560,8 @@ static UINT WINAPI expGetSystemDirectoryA( UINT uSize // size of directory buffer ){ dbgprintf("GetSystemDirectoryA(%p,%d)\n", lpBuffer,uSize); - if(!lpBuffer) strcpy(lpBuffer,"."); + if (!lpBuffer || uSize < 2) return 0; + strcpy(lpBuffer,"."); return 1; } /* |