Changeset 8712
- Timestamp:
- 08/04/08 11:05:29 (5 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgPlugins/quicktime/QTImportExport.cpp
r8132 r8712 248 248 // Convert From CString in filename to a PascalString in pstr 249 249 if (filename.length() > 255) { 250 CopyCStringToPascal(filename.c_str(), pstr);251 250 //hmm...not good, pascal string limit is 255! 252 251 //do some error handling maybe?! 252 throw QTImportExportException(0, "filename length limit exceeded"); 253 253 } 254 CopyCStringToPascal(filename.c_str(), pstr); 254 255 255 256 // Add filename extension … … 283 284 int depth = 32; 284 285 unsigned int xsize, ysize; 285 unsigned char* imageData ;286 unsigned char* imageData = 0; 286 287 287 288 // Data Handle for file data ( & load data from file ) … … 360 361 DisposeHandle(dataRef); 361 362 } 362 catch (QTImportExportException e)363 catch (QTImportExportException& e) 363 364 { 364 365 setError(e.what()); … … 384 385 385 386 387 unsigned int bytesPerPixel = depth / 8; 386 388 unsigned int glpixelFormat; 387 388 switch(depth >> 3) { 389 switch(bytesPerPixel) { 389 390 case 3 : 390 391 glpixelFormat = GL_RGB; … … 394 395 break; 395 396 default : 396 delete imageData;397 delete[] imageData; 397 398 setError("unknown pixelformat"); 398 399 return NULL; … … 400 401 } 401 402 402 unsigned char* swizzled = pepareBufferForOSG(imageData, depth >> 3, xsize, ysize);403 unsigned char* swizzled = pepareBufferForOSG(imageData, bytesPerPixel, xsize, ysize); 403 404 404 405 delete[] imageData; … … 407 408 image->setFileName(fileTypeHint.c_str()); 408 409 image->setImage(xsize,ysize,1, 409 depth >> 3,410 bytesPerPixel, 410 411 glpixelFormat, 411 412 GL_UNSIGNED_BYTE, … … 511 512 512 513 513 catch (QTImportExportException e)514 catch (QTImportExportException& e) 514 515 { 515 516 setError(e.what());
