Changeset 57 for trunk/JPGPROC/source/gbmsrc
- Timestamp:
- May 11, 2023, 10:44:53 PM (2 years ago)
- Location:
- trunk/JPGPROC/source/gbmsrc
- Files:
-
- 5 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(
Note:
See TracChangeset
for help on using the changeset viewer.