Merge branch 'bug_599_picload_fd_leak' into experimental
authorghost <andreas.monzner@multimedia-labs.de>
Tue, 5 Apr 2011 14:10:43 +0000 (16:10 +0200)
committerghost <andreas.monzner@multimedia-labs.de>
Tue, 5 Apr 2011 14:10:43 +0000 (16:10 +0200)
1  2 
lib/gdi/picexif.cpp

diff --combined lib/gdi/picexif.cpp
@@@ -108,7 -108,7 +108,7 @@@ bool Cexif::DecodeExif(const char *file
        strcpy(m_szLastError,"EXIF-Data not found");
  
        if (a != 0xff || fgetc(hFile) != M_SOI)
-               goto decode_exif_out;
+               goto decode_exif_out_false;
  
        for(;;)
        {
                if (SectionsRead >= MAX_SECTIONS)
                {
                        strcpy(m_szLastError,"Too many sections in jpg file");
-                       goto decode_exif_out;
+                       goto decode_exif_out_false;
                }
  
                for (a=0;a<7;a++)
                        if (a >= 6)
                        {
                                strcpy(m_szLastError,"too many padding unsigned chars\n");
-                               goto decode_exif_out;
+                               goto decode_exif_out_false;
                        }
                }
  
                if (marker == 0xff)
                {
                        strcpy(m_szLastError,"too many padding unsigned chars!");
-                       goto decode_exif_out;
+                       goto decode_exif_out_false;
                }
  
                Sections[SectionsRead].Type = marker;
                if (itemlen < 2)
                {
                        strcpy(m_szLastError,"invalid marker");
-                       goto decode_exif_out;
+                       goto decode_exif_out_false;
                }
                Sections[SectionsRead].Size = itemlen;
  
                if (Data == NULL)
                {
                        strcpy(m_szLastError,"Could not allocate memory");
-                       goto decode_exif_out;
+                       goto decode_exif_out_false;
                }
                Sections[SectionsRead].Data = Data;
  
                if (got != itemlen-2)
                {
                        strcpy(m_szLastError,"Premature end of file?");
-                       goto decode_exif_out;
+                       goto decode_exif_out_false;
                }
                SectionsRead += 1;
  
                switch(marker)
                {
                case M_SOS:
-                       goto decode_exif_out;
+                       goto decode_exif_out_true;
                case M_EOI:
                        printf("No image in jpeg!\n");
-                       goto decode_exif_out;
+                       goto decode_exif_out_false;
                case M_COM:
                        if (HaveCom)
                        {
                        break;
                }
        }
+ decode_exif_out_true:
        ret = true;
  
- decode_exif_out:
+ decode_exif_out_false:
        fclose(hFile);
        return ret;
  }
@@@ -437,7 -439,7 +439,7 @@@ bool Cexif::ProcessExifDir(unsigned cha
                        case 6:         strcpy(m_exifinfo->Orientation,"Right-Top"); break;
                        case 7:         strcpy(m_exifinfo->Orientation,"Right-Bottom"); break;
                        case 8:         strcpy(m_exifinfo->Orientation,"Left-Bottom"); break;
 -                      default:        strcpy(m_exifinfo->Orientation,"Undefined rotation value");
 +                      default:        strcpy(m_exifinfo->Orientation,"Undefined"); break;
                        }
                        break;
                case TAG_EXIF_IMAGELENGTH: