~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/blender/imbuf/intern/cineon/cineonlib.c

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2007-05-17 11:47:59 UTC
  • mfrom: (1.2.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20070517114759-yp4ybrnhp2u7pk66
Tags: 2.44-1
* New upstream release.
* Drop debian/patches/01_64bits_stupidity, not needed anymore: as of this
  version blender is 64 bits safe again. Adjust README.Debian accordingly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
static void
68
68
dumpCineonFileInfo(CineonFileInformation* fileInfo) {
69
69
        d_printf("\n--File Information--\n");
70
 
        d_printf("Magic: %8.8lX\n", ntohl(fileInfo->magic_num));
71
 
        d_printf("Image Offset %ld\n", ntohl(fileInfo->image_offset));
72
 
        d_printf("Generic Header size %ld\n", ntohl(fileInfo->gen_hdr_size));
73
 
        d_printf("Industry Header size %ld\n", ntohl(fileInfo->ind_hdr_size));
74
 
        d_printf("User Data size %ld\n", ntohl(fileInfo->user_data_size));
75
 
        d_printf("File size %ld\n", ntohl(fileInfo->file_size));
 
70
        d_printf("Magic: %8.8lX\n", (unsigned long)ntohl(fileInfo->magic_num));
 
71
        d_printf("Image Offset %ld\n", (long)ntohl(fileInfo->image_offset));
 
72
        d_printf("Generic Header size %ld\n", (long)ntohl(fileInfo->gen_hdr_size));
 
73
        d_printf("Industry Header size %ld\n", (long)ntohl(fileInfo->ind_hdr_size));
 
74
        d_printf("User Data size %ld\n", (long)ntohl(fileInfo->user_data_size));
 
75
        d_printf("File size %ld\n", (long)ntohl(fileInfo->file_size));
76
76
        d_printf("Version \"%s\"\n", fileInfo->vers);
77
77
        d_printf("File name \"%s\"\n", fileInfo->file_name);
78
78
        d_printf("Creation date \"%s\"\n", fileInfo->create_date);
112
112
                default: d_printf(" (unknown)\n"); break;
113
113
        }
114
114
        d_printf("      Bits per pixel %d\n", chan->bits_per_pixel);
115
 
        d_printf("      Pixels per line %ld\n", ntohl(chan->pixels_per_line));
116
 
        d_printf("      Lines per image %ld\n", ntohl(chan->lines_per_image));
117
 
        d_printf("      Ref low data %ld\n", ntohl(chan->ref_low_data));
 
115
        d_printf("      Pixels per line %ld\n", (long)ntohl(chan->pixels_per_line));
 
116
        d_printf("      Lines per image %ld\n", (long)ntohl(chan->lines_per_image));
 
117
        d_printf("      Ref low data %ld\n", (long)ntohl(chan->ref_low_data));
118
118
        d_printf("      Ref low quantity %f\n", ntohf(chan->ref_low_quantity));
119
 
        d_printf("      Ref high data %ld\n", ntohl(chan->ref_high_data));
 
119
        d_printf("      Ref high data %ld\n", (long)ntohl(chan->ref_high_data));
120
120
        d_printf("      Ref high quantity %f\n", ntohf(chan->ref_high_quantity));
121
121
}
122
122
 
231
231
        } else {
232
232
                d_printf(" positive\n");
233
233
        }
234
 
        d_printf("End of line padding %ld\n", ntohl(formatInfo->line_padding));
235
 
        d_printf("End of channel padding %ld\n", ntohl(formatInfo->channel_padding));
 
234
        d_printf("End of line padding %ld\n", (long)ntohl(formatInfo->line_padding));
 
235
        d_printf("End of channel padding %ld\n", (long)ntohl(formatInfo->channel_padding));
236
236
}
237
237
 
238
238
static void
256
256
static void
257
257
dumpCineonOriginationInfo(CineonOriginationInformation* originInfo) {
258
258
        d_printf("\n--Origination Information--\n");
259
 
        d_printf("X offset %ld\n", ntohl(originInfo->x_offset));
260
 
        d_printf("Y offset %ld\n", ntohl(originInfo->y_offset));
 
259
        d_printf("X offset %ld\n", (long)ntohl(originInfo->x_offset));
 
260
        d_printf("Y offset %ld\n", (long)ntohl(originInfo->y_offset));
261
261
        d_printf("File name \"%s\"\n", originInfo->file_name);
262
262
        d_printf("Creation date \"%s\"\n", originInfo->create_date);
263
263
        d_printf("Creation time \"%s\"\n", originInfo->create_time);
525
525
        /* let's assume cineon files are always network order */
526
526
        if (header.fileInfo.magic_num != ntohl(CINEON_FILE_MAGIC)) {
527
527
                if (verbose) d_printf("Bad magic number %8.8lX in \"%s\".\n",
528
 
                        ntohl(header.fileInfo.magic_num), filename);
 
528
                        (unsigned long)ntohl(header.fileInfo.magic_num), filename);
529
529
                cineonClose(cineon);
530
530
                return 0;
531
531
        }
624
624
 
625
625
        /* let's assume cineon files are always network order */
626
626
        if (header.fileInfo.magic_num != ntohl(CINEON_FILE_MAGIC)) {
627
 
                if (verbose) d_printf("Bad magic number %8.8lX in\n", ntohl(header.fileInfo.magic_num));
 
627
                if (verbose) d_printf("Bad magic number %8.8lX in\n", (unsigned long)ntohl(header.fileInfo.magic_num));
628
628
 
629
629
                cineonClose(cineon);
630
630
                return 0;
662
662
 
663
663
        i = cineon->imageOffset;
664
664
        
665
 
        if (i >= size) {
 
665
        if (logimage_fseek(cineon, cineon->imageOffset, SEEK_SET) != 0) {
666
666
                if (verbose) d_printf("Couldn't seek to image data at %d\n", cineon->imageOffset);
667
667
                cineonClose(cineon);
668
668
                return 0;
669
669
        }
 
670
        
670
671
        cineon->fileYPos = 0;
671
672
 
672
673
        logImageGetByteConversionDefaults(&cineon->params);