Changeset 57
- Timestamp:
- May 11, 2023, 10:44:53 PM (2 years ago)
- Location:
- trunk
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JPGPROC/source/gbmsrc/gbmhdr.c
r2 r57 194 194 /*...shandle a filename argument:16:*/ 195 195 { 196 char fn[500+1], *opt;196 char fn[500+1] = {0}, *opt; 197 197 strncpy(fn, argv[i], 500); 198 198 if ( (opt = strchr(fn, ',')) != NULL ) -
trunk/JPGPROC/source/gbmsrc/gbmlbm.c
r2 r57 1218 1218 return rc; 1219 1219 1220 for ( i = 0; i < =0x10; i++ )1220 for ( i = 0; i < 0x10; i++ ) 1221 1221 gbmrgb_grey[i].r = gbmrgb_grey[i].g = gbmrgb_grey[i].b = (byte) (i * 0x11); 1222 1222 -
trunk/JPGPROC/source/gbmsrc/gbmsize.c
r2 r57 112 112 int w = -1, h = -1; 113 113 char fn_src[500+1], fn_dst[500+1], *opt_src, *opt_dst; 114 int fd , ft_src, ft_dst, i, stride, stride2, flag;114 int fd = 0, ft_src, ft_dst, i, stride, stride2, flag; 115 115 GBM_ERR rc; 116 116 GBMFT gbmft; -
trunk/JPGPROC/source/gbmsrc/gbmtifh.c
r2 r57 310 310 gbm_file_lseek(fd, offset_ifd, SEEK_SET); 311 311 while ( n_ifds_to_skip-- > 0 ) 312 if ( !skip_ifd(fd, motorola) ) 312 if ( !skip_ifd(fd, motorola) ) { 313 ifh_free(ifh); 313 314 return TE_N_IFD; 315 } 314 316 315 317 if ( (ecode = read_ifd(fd, motorola, &(ifh->ifd))) != TE_OK ) … … 443 445 if ( (byte_ptr = (byte *) malloc((size_t) (n * sizeof(byte)))) == NULL ) 444 446 return FALSE; 445 if ( (tag = get_tag_slot(type, ifd)) == NULL ) 446 return FALSE; 447 if ( (tag = get_tag_slot(type, ifd)) == NULL ) { 448 free(byte_ptr); 449 return FALSE; 450 } 447 451 tag->type = type; 448 452 tag->data_type = D_BYTE; … … 452 456 value, 453 457 n * sizeof(byte)); 458 free(byte_ptr); 454 459 return TRUE; 455 460 } … … 465 470 if ( (ascii_ptr = (char *) malloc((size_t) n)) == NULL ) 466 471 return FALSE; 467 if ( (tag = get_tag_slot(type, ifd)) == NULL ) 468 return FALSE; 472 if ( (tag = get_tag_slot(type, ifd)) == NULL ) { 473 free(ascii_ptr); 474 return FALSE; 475 } 469 476 tag->type = type; 470 477 tag->data_type = D_ASCII; 471 478 tag->length = (long) n; 472 479 strcpy(tag->value = ascii_ptr, value); 480 free(ascii_ptr); 473 481 return TRUE; 474 482 } … … 482 490 if ( (short_ptr = (short *) malloc((size_t) (n * sizeof(short)))) == NULL ) 483 491 return FALSE; 484 if ( (tag = get_tag_slot(type, ifd)) == NULL ) 485 return FALSE; 492 if ( (tag = get_tag_slot(type, ifd)) == NULL ) { 493 free(short_ptr); 494 return FALSE; 495 } 486 496 tag->type = type; 487 497 tag->data_type = D_SHORT; … … 491 501 value, 492 502 n * sizeof(short)); 503 free(short_ptr); 493 504 return TRUE; 494 505 } … … 502 513 if ( (long_ptr = (long *) malloc((size_t) (n * sizeof(long)))) == NULL ) 503 514 return FALSE; 504 if ( (tag = get_tag_slot(type, ifd)) == NULL ) 505 return FALSE; 515 if ( (tag = get_tag_slot(type, ifd)) == NULL ) { 516 free(long_ptr); 517 return FALSE; 518 } 506 519 tag->type = type; 507 520 tag->data_type = D_LONG; … … 511 524 value, 512 525 n * sizeof(long)); 526 free(long_ptr); 513 527 return TRUE; 514 528 } … … 522 536 if ( (rational_ptr = (rational *) malloc((size_t) (n * sizeof(rational)))) == NULL ) 523 537 return FALSE; 524 if ( (tag = get_tag_slot(type, ifd)) == NULL ) 525 return FALSE; 538 if ( (tag = get_tag_slot(type, ifd)) == NULL ) { 539 free(rational_ptr); 540 return FALSE; 541 } 526 542 tag->type = type; 527 543 tag->data_type = D_RATIONAL; … … 531 547 value, 532 548 n * sizeof(rational)); 549 free(rational_ptr); 533 550 return TRUE; 534 551 } -
trunk/JPGPROC/source/gbmsrc/x.c
r2 r57 148 148 ys[i] = ys[i+1] - ys[i]; 149 149 150 150 } 151 151 152 152 static void simple_scale_8( -
trunk/JPGPROC/source/jpgproc.c
r2 r57 655 655 656 656 MMIMAGEHEADER MMImgHdr; 657 ULONG ulWidth ;658 ULONG ulHeight ;657 ULONG ulWidth = 0; 658 ULONG ulHeight = 0; 659 659 PBYTE lpRGBBufPtr; 660 660 -
trunk/classes/c/c_audio/cwastream.c
r3 r57 75 75 76 76 if(!fgets(chrBuf, ulBufSize, fStream)) { 77 fclose(fStream); 77 // Fixme double deallocation is this missing a break; 78 //fclose(fStream); 78 79 sprintf(chrBuf, DEFAULT_AUDIOSTREAM_SERVER); 79 80 } -
trunk/classes/c/c_common/helper.c
r49 r57 62 62 HAPP happ; 63 63 HWND hwndAppTerminateHandler; 64 char startupDir[CCHMAXPATH] ;64 char startupDir[CCHMAXPATH] = {0}; 65 65 char *chrPtr; 66 66 … … 73 73 pDetails.pszParameters = parameters; 74 74 /* Set the startup directory to the location of the executable */ 75 strncpy(startupDir, wrapperExe, sizeof(startupDir) );75 strncpy(startupDir, wrapperExe, sizeof(startupDir) - 1); 76 76 // SysWriteToTrapLog("1: %s %s\n", startupDir, wrapperExe); 77 77 if((chrPtr=strrchr(startupDir,'\\'))!=NULLHANDLE) { -
trunk/classes/c/c_image/cwbmp.c
r2 r57 706 706 if(ppDetailsData) 707 707 { 708 ULONG ulWidth , ulHeight, ulDepth;708 ULONG ulWidth = 0, ulHeight = 0, ulDepth = 0; 709 709 PBITMAPINFOHEADER2 pBmpInfoHeader2; 710 710 … … 725 725 } 726 726 727 /* Fill the structure with the info to be displayed */ 727 /* Fill the structure with the info to be displayed */ 728 // Fixme ulWidth and freinds are potentally uninitulized is the } above in the wrong place 728 729 pImageDetails=(PIMAGEDETAILS)*ppDetailsData; 729 730 pImageDetails->ulWidth=ulWidth; -
trunk/classes/c/c_mm/cwmmdisk.c
r2 r57 97 97 if((hObject=WinQueryObject(chrPlayerID))!=NULLHANDLE) { 98 98 WPObject *wpObject; 99 HWND hwnd ;99 HWND hwnd = 0; 100 100 wpObject=_wpclsQueryObject( _CWMMDisk , hObject); 101 101 if(somIsObj(wpObject)) { -
trunk/classes/c/c_mm/mmfolder.c
r2 r57 358 358 if((somIsObj(cwImageClass)||somIsObj(cwBitmapClass)) && !(_wpQueryStyle(wpObject) & OBJSTYLE_TEMPLATE)) { 359 359 HBITMAP hbm=NULLHANDLE; 360 PBITMAPINFOHEADER2 pBmpInfoHeader2 ;360 PBITMAPINFOHEADER2 pBmpInfoHeader2=NULLHANDLE; 361 361 #ifdef DEBUG 362 362 SysWriteToTrapLog("Object is an image. (%s line: %d)\n", __FUNCTION__, __LINE__); -
trunk/classes/mm-progs/MMPlayer/playaudio.c
r4 r57 123 123 ULONG rc; 124 124 int iWavePriv; 125 int iTime2 ;125 int iTime2 = 0; 126 126 HWND hwndNotify; 127 127 -
trunk/classes/mm-progs/_MMBROWSE/mmbrowse.c
r2 r57 1259 1259 PSZ pszFileName) 1260 1260 { 1261 HBITMAP hBmp ;1261 HBITMAP hBmp = 0; 1262 1262 BOOL bReturnCode; 1263 1263 -
trunk/classes/mm-progs/_pmtst/volume.c
r2 r57 929 929 if(ulFileSize!=fread(pData, sizeof(BYTE), ulFileSize, file)) 930 930 { 931 free(pData); 931 free(pData); 932 fclose(file); 932 933 return NULLHANDLE; 933 934 } -
trunk/classes/mm-progs/videoplayer/playaudio.c
r2 r57 130 130 ULONG rc; 131 131 int iWavePriv; 132 int iTime2 ;132 int iTime2 = 0; 133 133 HWND hwndNotify; 134 134 -
trunk/mediafolder/c/cddb/cddbcls.cpp
r2 r57 146 146 void printError(char* errorString) 147 147 { 148 char buffer[CCHMAXPATH];148 char buffer[CCHMAXPATH] = {0}; 149 149 char *ptr; 150 150 151 strncpy(buffer, errorString, sizeof(buffer) );151 strncpy(buffer, errorString, sizeof(buffer) - 1); 152 152 fprintf(stderr,"%s",errorString); 153 153 /* hwndError is global, so this isn't threadsafe */ -
trunk/mediafolder/c/helper/cddbhelper.cpp
r2 r57 40 40 void extern printError(char* errorString) 41 41 { 42 char buffer[CCHMAXPATH];42 char buffer[CCHMAXPATH] = {0}; 43 43 char *ptr; 44 44 … … 47 47 writeLog(errorString); 48 48 if(hwndError) { 49 strncpy(buffer, errorString, sizeof(buffer) );49 strncpy(buffer, errorString, sizeof(buffer) - 1); 50 50 ptr=strchr(buffer,'\n'); 51 51 if(ptr) { -
trunk/mediafolder/c/helper/launchpad.cpp
r2 r57 557 557 static HWND hwndBubbleClient; 558 558 ULONG style=FCF_BORDER|FCF_NOBYTEALIGN; 559 char winText[255] ;559 char winText[255] = {0}; 560 560 561 561 /* Get window text for size calculating */ … … 1028 1028 if(somIsObj(folderClass)) 1029 1029 wpFolder=(WPFolder*)((M_WPFolder*)folderClass)->wpclsQueryFolder(chrConfigID, FALSE); 1030 } 1031 1030 if(!somIsObj(wpFolder)) 1031 return FALSE; 1032 } 1033 else 1034 return FALSE; 1035 1036 // Fixme see line 1106 1032 1037 ulBufferSize=sizeof(chrPath); 1033 1038 wpFolder->wpQueryRealName(chrPath, &ulBufferSize, TRUE); … … 1101 1106 return FALSE; 1102 1107 } 1103 1108 else 1109 return FALSE; 1110 // Fixme wpFolder can be uninittailized if(somIsObj(wpParentFolder)) is false sould we return FALSE 1104 1111 /* Build ini name */ 1105 1112 ulBufferSize=sizeof(chrPath); -
trunk/mediafolder/c/mediafldr/mediafolder.cpp
r2 r57 867 867 static int _getRandomTrack( MEDIAFLDRDATA* mfData) 868 868 { 869 int zufall ;869 int zufall = 0; 870 870 DATETIME DT; 871 871 INT seed, start, iCheck=0; … … 928 928 ULONG rc; 929 929 int iWavePriv; 930 int iTime2 ;930 int iTime2 = 0; 931 931 HWND hwndNotify; 932 932 BOOL notFound; -
trunk/test/zufall.c
r2 r57 8 8 int getRand() 9 9 { 10 int zufall ;10 int zufall = 0; 11 11 DATETIME DT; 12 12 INT seed, start, iCheck=0;
Note:
See TracChangeset
for help on using the changeset viewer.