Ticket #34541: patch-frmts_gif_gifdataset_cpp.diff
File patch-frmts_gif_gifdataset_cpp.diff, 1.9 KB (added by florian@…, 12 years ago) |
---|
-
frmts/gif/gifdataset.cpp
old new 471 471 472 472 /************************************************************************/ 473 /* GDALPrintGifError() */ 474 /************************************************************************/ 475 476 static void GDALPrintGifError(const char* pszMsg) 477 { 478 /* GIFLIB_MAJOR is only defined in libgif >= 4.2.0 */ 479 /* libgif 4.2.0 has retired PrintGifError() and added GifErrorString() */ 480 #if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) && \ 481 ((GIFLIB_MAJOR == 4 && GIFLIB_MINOR >= 2) || GIFLIB_MAJOR > 4) 482 /* Static string actually, hence the const char* cast */ 483 const char* pszGIFLIBError = (const char*) GifErrorString(); 484 if (pszGIFLIBError == NULL) 485 pszGIFLIBError = "Unknown error"; 486 CPLError( CE_Failure, CPLE_AppDefined, 487 "%s. GIFLib Error : %s", pszMsg, pszGIFLIBError ); 488 #else 489 PrintGifError(); 490 CPLError( CE_Failure, CPLE_AppDefined, "%s", pszMsg ); 491 #endif 492 } 493 494 /************************************************************************/ 473 495 /* CreateCopy() */ 474 496 /************************************************************************/ … … 597 619 { 598 620 FreeMapObject(psGifCT); 599 PrintGifError(); 600 CPLError( CE_Failure, CPLE_AppDefined, 601 "Error writing gif file." ); 621 GDALPrintGifError("Error writing gif file."); 602 622 EGifCloseFile(hGifFile); 603 623 VSIFCloseL( fp ); … … 623 643 if (EGifPutImageDesc(hGifFile, 0, 0, nXSize, nYSize, bInterlace, NULL) == GIF_ERROR ) 624 644 { 625 PrintGifError(); 626 CPLError( CE_Failure, CPLE_AppDefined, 627 "Error writing gif file." ); 645 GDALPrintGifError("Error writing gif file."); 628 646 EGifCloseFile(hGifFile); 629 647 VSIFCloseL( fp );