Changeset 79
- Timestamp:
- 09/12/09 07:56:09 (6 months ago)
- Location:
- ImageMagick/trunk/coders
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
ImageMagick/trunk/coders/cmyk.c
r1 r79 215 215 length=GetQuantumExtent(canvas_image,quantum_info,quantum_type); 216 216 count=ReadBlob(image,length,pixels); 217 if (count != (ssize_t) length)218 break;219 217 } 220 218 for (y=0; y < (long) image->extract_info.height; y++) … … 235 233 *__restrict q; 236 234 235 if (count != (ssize_t) length) 236 { 237 ThrowFileException(exception,CorruptImageError, 238 "UnexpectedEndOfFile",image->filename); 239 break; 240 } 237 241 q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1, 238 242 exception); … … 277 281 } 278 282 count=ReadBlob(image,length,pixels); 279 if (count != (ssize_t) length)280 break;281 283 } 282 284 break; … … 301 303 length=GetQuantumExtent(canvas_image,quantum_info,CyanQuantum); 302 304 count=ReadBlob(image,length,pixels); 303 if (count != (ssize_t) length)304 break;305 305 } 306 306 for (y=0; y < (long) image->extract_info.height; y++) … … 321 321 *__restrict q; 322 322 323 if (count != (ssize_t) length) 324 { 325 ThrowFileException(exception,CorruptImageError, 326 "UnexpectedEndOfFile",image->filename); 327 break; 328 } 323 329 for (i=0; i < (image->matte != MagickFalse ? 5 : 4); i++) 324 330 { … … 363 369 } 364 370 count=ReadBlob(image,length,pixels); 365 if (count != (ssize_t) length)366 break;367 371 } 368 372 if (image->previous == (Image *) NULL) … … 384 388 length=GetQuantumExtent(canvas_image,quantum_info,CyanQuantum); 385 389 count=ReadBlob(image,length,pixels); 386 if (count != (ssize_t) length)387 break;388 390 } 389 391 for (y=0; y < (long) image->extract_info.height; y++) … … 398 400 *__restrict q; 399 401 402 if (count != (ssize_t) length) 403 { 404 ThrowFileException(exception,CorruptImageError, 405 "UnexpectedEndOfFile",image->filename); 406 break; 407 } 400 408 q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1, 401 409 exception); … … 426 434 } 427 435 count=ReadBlob(image,length,pixels); 428 if (count != (ssize_t) length)429 break;430 436 } 431 437 if (image->previous == (Image *) NULL) … … 446 452 *__restrict q; 447 453 454 if (count != (ssize_t) length) 455 { 456 ThrowFileException(exception,CorruptImageError, 457 "UnexpectedEndOfFile",image->filename); 458 break; 459 } 448 460 q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1, 449 461 exception); … … 474 486 } 475 487 count=ReadBlob(image,length,pixels); 476 if (count != (ssize_t) length)477 break;478 488 } 479 489 if (image->previous == (Image *) NULL) … … 494 504 *__restrict q; 495 505 506 if (count != (ssize_t) length) 507 { 508 ThrowFileException(exception,CorruptImageError, 509 "UnexpectedEndOfFile",image->filename); 510 break; 511 } 496 512 q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1, 497 513 exception); … … 522 538 } 523 539 count=ReadBlob(image,length,pixels); 524 if (count != (ssize_t) length)525 break;526 540 } 527 541 if (image->previous == (Image *) NULL) … … 548 562 *__restrict q; 549 563 564 if (count != (ssize_t) length) 565 { 566 ThrowFileException(exception,CorruptImageError, 567 "UnexpectedEndOfFile",image->filename); 568 break; 569 } 550 570 q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1, 551 571 exception); … … 578 598 } 579 599 count=ReadBlob(image,length,pixels); 580 if (count != (ssize_t) length)581 break;582 600 } 583 601 if (image->previous == (Image *) NULL) … … 600 618 *__restrict q; 601 619 620 if (count != (ssize_t) length) 621 { 622 ThrowFileException(exception,CorruptImageError, 623 "UnexpectedEndOfFile",image->filename); 624 break; 625 } 602 626 q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1, 603 627 exception); … … 629 653 } 630 654 count=ReadBlob(image,length,pixels); 631 if (count != (ssize_t) length)632 break;633 655 } 634 656 if (image->previous == (Image *) NULL) … … 677 699 } 678 700 count=ReadBlob(image,length,pixels); 679 if (count != (ssize_t) length)680 break;681 701 for (y=0; y < (long) image->extract_info.height; y++) 682 702 { … … 690 710 *__restrict q; 691 711 712 if (count != (ssize_t) length) 713 { 714 ThrowFileException(exception,CorruptImageError, 715 "UnexpectedEndOfFile",image->filename); 716 break; 717 } 692 718 q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1, 693 719 exception); … … 718 744 } 719 745 count=ReadBlob(image,length,pixels); 720 if (count != (ssize_t) length)721 break;722 746 } 723 747 if (image->previous == (Image *) NULL) … … 746 770 } 747 771 count=ReadBlob(image,length,pixels); 748 if (count != (ssize_t) length)749 break;750 772 for (y=0; y < (long) image->extract_info.height; y++) 751 773 { … … 759 781 *__restrict q; 760 782 783 if (count != (ssize_t) length) 784 { 785 ThrowFileException(exception,CorruptImageError, 786 "UnexpectedEndOfFile",image->filename); 787 break; 788 } 761 789 q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1, 762 790 exception); … … 787 815 } 788 816 count=ReadBlob(image,length,pixels); 789 if (count != (ssize_t) length)790 break;791 817 } 792 818 if (image->previous == (Image *) NULL) … … 815 841 } 816 842 count=ReadBlob(image,length,pixels); 817 if (count != (ssize_t) length)818 break;819 843 for (y=0; y < (long) image->extract_info.height; y++) 820 844 { … … 828 852 *__restrict q; 829 853 854 if (count != (ssize_t) length) 855 { 856 ThrowFileException(exception,CorruptImageError, 857 "UnexpectedEndOfFile",image->filename); 858 break; 859 } 830 860 q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1, 831 861 exception); … … 856 886 } 857 887 count=ReadBlob(image,length,pixels); 858 if (count != (ssize_t) length)859 break;860 888 } 861 889 if (image->previous == (Image *) NULL) … … 884 912 } 885 913 count=ReadBlob(image,length,pixels); 886 if (count != (ssize_t) length)887 break;888 914 for (y=0; y < (long) image->extract_info.height; y++) 889 915 { … … 903 929 *__restrict q; 904 930 931 if (count != (ssize_t) length) 932 { 933 ThrowFileException(exception,CorruptImageError, 934 "UnexpectedEndOfFile",image->filename); 935 break; 936 } 905 937 q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1, 906 938 exception); … … 933 965 } 934 966 count=ReadBlob(image,length,pixels); 935 if (count != (ssize_t) length)936 break;937 967 } 938 968 if (image->previous == (Image *) NULL) … … 963 993 } 964 994 count=ReadBlob(image,length,pixels); 965 if (count != (ssize_t) length)966 break;967 995 for (y=0; y < (long) image->extract_info.height; y++) 968 996 { … … 976 1004 *__restrict q; 977 1005 1006 if (count != (ssize_t) length) 1007 { 1008 ThrowFileException(exception,CorruptImageError, 1009 "UnexpectedEndOfFile",image->filename); 1010 break; 1011 } 978 1012 q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1, 979 1013 exception); … … 1004 1038 } 1005 1039 count=ReadBlob(image,length,pixels); 1006 if (count != (ssize_t) length)1007 break;1008 1040 } 1009 1041 if (image->previous == (Image *) NULL) -
ImageMagick/trunk/coders/rgb.c
r75 r79 256 256 *__restrict q; 257 257 258 if (count != (ssize_t) length) 259 { 260 ThrowFileException(exception,CorruptImageError, 261 "UnexpectedEndOfFile",image->filename); 262 break; 263 } 258 264 q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1, 259 265 exception); … … 303 309 } 304 310 count=ReadBlob(image,length,pixels); 305 if (count != (ssize_t) length)306 break;307 311 } 308 312 break; … … 317 321 length=GetQuantumExtent(canvas_image,quantum_info,quantum_types[0]); 318 322 count=ReadBlob(image,length,pixels); 319 if (count != (ssize_t) length)320 break;321 323 } 322 324 for (y=0; y < (long) image->extract_info.height; y++) … … 331 333 *__restrict q; 332 334 335 if (count != (ssize_t) length) 336 { 337 ThrowFileException(exception,CorruptImageError, 338 "UnexpectedEndOfFile",image->filename); 339 break; 340 } 333 341 for (i=0; i < channels; i++) 334 342 { … … 365 373 } 366 374 count=ReadBlob(image,length,pixels); 367 if (count != (ssize_t) length)368 break;369 375 } 370 376 if (image->previous == (Image *) NULL) … … 386 392 length=GetQuantumExtent(canvas_image,quantum_info,quantum_types[0]); 387 393 count=ReadBlob(image,length,pixels); 388 if (count != (ssize_t) length)389 break;390 394 } 391 395 for (i=0; i < channels; i++) … … 402 406 *__restrict q; 403 407 408 if (count != (ssize_t) length) 409 { 410 ThrowFileException(exception,CorruptImageError, 411 "UnexpectedEndOfFile",image->filename); 412 break; 413 } 404 414 q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1, 405 415 exception); … … 438 448 } 439 449 count=ReadBlob(image,length,pixels); 440 if (count != (ssize_t) length)441 break;442 450 } 443 451 if (image->previous == (Image *) NULL) … … 490 498 } 491 499 count=ReadBlob(image,length,pixels); 492 if (count != (ssize_t) length)493 break;494 500 for (y=0; y < (long) image->extract_info.height; y++) 495 501 { … … 503 509 *__restrict q; 504 510 511 if (count != (ssize_t) length) 512 { 513 ThrowFileException(exception,CorruptImageError, 514 "UnexpectedEndOfFile",image->filename); 515 break; 516 } 505 517 q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1, 506 518 exception); … … 539 551 } 540 552 count=ReadBlob(image,length,pixels); 541 if (count != (ssize_t) length)542 break;543 553 } 544 554 if (image->previous == (Image *) NULL) -
ImageMagick/trunk/coders/ycbcr.c
r75 r79 222 222 length=GetQuantumExtent(canvas_image,quantum_info,quantum_type); 223 223 count=ReadBlob(image,length,pixels); 224 if (count != (ssize_t) length)225 break;226 224 } 227 225 for (y=0; y < (long) image->extract_info.height; y++) 228 226 { 227 if (count != (ssize_t) length) 228 { 229 ThrowFileException(exception,CorruptImageError, 230 "UnexpectedEndOfFile",image->filename); 231 break; 232 } 229 233 q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1, 230 234 exception); … … 265 269 } 266 270 count=ReadBlob(image,length,pixels); 267 if (count != (ssize_t) length)268 break;269 271 } 270 272 break; … … 288 290 length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum); 289 291 count=ReadBlob(image,length,pixels); 292 } 293 for (y=0; y < (long) image->extract_info.height; y++) 294 { 295 for (i=0; i < (image->matte != MagickFalse ? 4 : 3); i++) 296 { 290 297 if (count != (ssize_t) length) 291 break; 292 } 293 for (y=0; y < (long) image->extract_info.height; y++) 294 { 295 for (i=0; i < (image->matte != MagickFalse ? 4 : 3); i++) 296 { 298 { 299 ThrowFileException(exception,CorruptImageError, 300 "UnexpectedEndOfFile",image->filename); 301 break; 302 } 297 303 quantum_type=quantum_types[i]; 298 304 q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1, … … 331 337 } 332 338 count=ReadBlob(image,length,pixels); 333 if (count != (ssize_t) length)334 break;335 339 } 336 340 if (image->previous == (Image *) NULL) … … 352 356 length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum); 353 357 count=ReadBlob(image,length,pixels); 354 if (count != (ssize_t) length)355 break;356 358 } 357 359 for (y=0; y < (long) image->extract_info.height; y++) 358 360 { 361 if (count != (ssize_t) length) 362 { 363 ThrowFileException(exception,CorruptImageError, 364 "UnexpectedEndOfFile",image->filename); 365 break; 366 } 359 367 q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1, 360 368 exception); … … 385 393 } 386 394 count=ReadBlob(image,length,pixels); 387 if (count != (ssize_t) length)388 break;389 395 } 390 396 if (image->previous == (Image *) NULL) … … 396 402 for (y=0; y < (long) image->extract_info.height; y++) 397 403 { 404 if (count != (ssize_t) length) 405 { 406 ThrowFileException(exception,CorruptImageError, 407 "UnexpectedEndOfFile",image->filename); 408 break; 409 } 398 410 q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1, 399 411 exception); … … 424 436 } 425 437 count=ReadBlob(image,length,pixels); 426 if (count != (ssize_t) length)427 break;428 438 } 429 439 if (image->previous == (Image *) NULL) … … 435 445 for (y=0; y < (long) image->extract_info.height; y++) 436 446 { 447 if (count != (ssize_t) length) 448 { 449 ThrowFileException(exception,CorruptImageError, 450 "UnexpectedEndOfFile",image->filename); 451 break; 452 } 437 453 q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1, 438 454 exception); … … 463 479 } 464 480 count=ReadBlob(image,length,pixels); 465 if (count != (ssize_t) length)466 break;467 481 } 468 482 if (image->previous == (Image *) NULL) … … 476 490 for (y=0; y < (long) image->extract_info.height; y++) 477 491 { 492 if (count != (ssize_t) length) 493 { 494 ThrowFileException(exception,CorruptImageError, 495 "UnexpectedEndOfFile",image->filename); 496 break; 497 } 478 498 q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1, 479 499 exception); … … 505 525 } 506 526 count=ReadBlob(image,length,pixels); 507 if (count != (ssize_t) length)508 break;509 527 } 510 528 if (image->previous == (Image *) NULL) … … 553 571 } 554 572 count=ReadBlob(image,length,pixels); 555 if (count != (ssize_t) length)556 break;557 573 for (y=0; y < (long) image->extract_info.height; y++) 558 574 { 575 if (count != (ssize_t) length) 576 { 577 ThrowFileException(exception,CorruptImageError, 578 "UnexpectedEndOfFile",image->filename); 579 break; 580 } 559 581 q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1, 560 582 exception); … … 585 607 } 586 608 count=ReadBlob(image,length,pixels); 587 if (count != (ssize_t) length)588 break;589 609 } 590 610 if (image->previous == (Image *) NULL) … … 613 633 } 614 634 count=ReadBlob(image,length,pixels); 615 if (count != (ssize_t) length)616 break;617 635 for (y=0; y < (long) image->extract_info.height; y++) 618 636 { 637 if (count != (ssize_t) length) 638 { 639 ThrowFileException(exception,CorruptImageError, 640 "UnexpectedEndOfFile",image->filename); 641 break; 642 } 619 643 q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1, 620 644 exception); … … 645 669 } 646 670 count=ReadBlob(image,length,pixels); 647 if (count != (ssize_t) length)648 break;649 671 } 650 672 if (image->previous == (Image *) NULL) … … 673 695 } 674 696 count=ReadBlob(image,length,pixels); 675 if (count != (ssize_t) length)676 break;677 697 for (y=0; y < (long) image->extract_info.height; y++) 678 698 { 699 if (count != (ssize_t) length) 700 { 701 ThrowFileException(exception,CorruptImageError, 702 "UnexpectedEndOfFile",image->filename); 703 break; 704 } 679 705 q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1, 680 706 exception); … … 705 731 } 706 732 count=ReadBlob(image,length,pixels); 707 if (count != (ssize_t) length)708 break;709 733 } 710 734 if (image->previous == (Image *) NULL) … … 735 759 } 736 760 count=ReadBlob(image,length,pixels); 737 if (count != (ssize_t) length)738 break;739 761 for (y=0; y < (long) image->extract_info.height; y++) 740 762 { 763 if (count != (ssize_t) length) 764 { 765 ThrowFileException(exception,CorruptImageError, 766 "UnexpectedEndOfFile",image->filename); 767 break; 768 } 741 769 q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1, 742 770 exception); … … 768 796 } 769 797 count=ReadBlob(image,length,pixels); 770 if (count != (ssize_t) length)771 break;772 798 } 773 799 if (image->previous == (Image *) NULL)
