Advertisement
Guest User

Untitled

a guest
Jun 11th, 2014
372
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.40 KB | None | 0 0
  1. diff --git "a/C:\\Users\\user\\AppData\\Local\\Temp\\TortoiseGit\\ximEFE2.tmp\\ximaenc-54f8e79-left.cpp" "b/E:\\XBMC-Source2\\xbmc\\lib\\cximage-6.0\\CxImage\\ximaenc.cpp"
  2. index 14e7890..6ab922d 100644
  3. --- "a/C:\\Users\\user\\AppData\\Local\\Temp\\TortoiseGit\\ximEFE2.tmp\\ximaenc-54f8e79-left.cpp"
  4. +++ "b/E:\\XBMC-Source2\\xbmc\\lib\\cximage-6.0\\CxImage\\ximaenc.cpp"
  5. @@ -803,7 +803,7 @@ bool CxImage::Decode(CxFile *hFile, DWORD imagetype)
  6.            // libDCR performs a high volume of seeks/reads which XBMC's
  7.            // VFS cannot sustain efficiently, therefore read the file into
  8.            // memory and send it to the decoder.
  9. -
  10. +        
  11.            long buffer_size = hFile->Size();
  12.            unsigned char* buffer = (unsigned char*)malloc( buffer_size );
  13.  
  14. @@ -814,11 +814,16 @@ bool CxImage::Decode(CxFile *hFile, DWORD imagetype)
  15.              CxMemFile hMemFile( buffer, buffer_size );
  16.              if (newima.Decode( &hMemFile ))
  17.              {
  18. +             free (buffer);
  19.                Transfer(newima);
  20.                return true;
  21.              }
  22.              else
  23. -              hFile->Seek(pos, SEEK_SET);
  24. +           {
  25. +              free (buffer);
  26. +              strcpy(info.szLastError,newima.GetLastError());
  27. +              return false;
  28. +           }
  29.            }
  30.            else
  31.            {
  32. @@ -828,8 +833,10 @@ bool CxImage::Decode(CxFile *hFile, DWORD imagetype)
  33.                Transfer(newima);
  34.                return true;
  35.              }
  36. -            else
  37. -              hFile->Seek(pos,SEEK_SET);
  38. +            else
  39. +           {
  40. +              hFile->Seek(pos,SEEK_SET);
  41. +           }
  42.            }
  43.          }
  44.  #endif
  45. @@ -1051,7 +1058,7 @@ bool CxImage::Decode(CxFile *hFile, DWORD imagetype)
  46.        // libDCR performs a high volume of seeks/reads which XBMC's
  47.        // VFS cannot sustain efficiently, therefore read the file into
  48.        // memory and send it to the decoder.
  49. -
  50. +    
  51.        long buffer_size = hFile->Size();
  52.        unsigned char* buffer = (unsigned char*)malloc( buffer_size );
  53.  
  54. @@ -1062,11 +1069,13 @@ bool CxImage::Decode(CxFile *hFile, DWORD imagetype)
  55.          CxMemFile hMemFile( buffer, buffer_size );
  56.          if (newima.Decode( &hMemFile ))
  57.          {
  58. +         free (buffer);
  59.            Transfer(newima);
  60.            return true;
  61.          }
  62.          else
  63.          {
  64. +         free (buffer);
  65.            strcpy(info.szLastError,newima.GetLastError());
  66.            return false;
  67.          }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement