~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to plug-ins/file-psd/psd-load.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2008-10-10 00:13:42 UTC
  • mfrom: (1.1.16 upstream)
  • Revision ID: james.westby@ubuntu.com-20081010001342-uja9qine9uybggd9
Tags: 2.6.1-1ubuntu1
* Sync new bugfix version on debian (lp: #280345, #280848)
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch:
  - updated some strings for ubuntu
* debian/rules:
  - updated translation templates

Show diffs side-by-side

added added

removed removed

Lines of Context:
1055
1055
          lyr_chn = g_new (PSDchannel *, lyr_a[lidx]->num_channels);
1056
1056
          for (cidx = 0; cidx < lyr_a[lidx]->num_channels; ++cidx)
1057
1057
            {
 
1058
              guint16 comp_mode = PSD_COMP_RAW;
 
1059
 
1058
1060
              /* Allocate channel record */
1059
1061
              lyr_chn[cidx] = g_malloc (sizeof (PSDchannel) );
1060
1062
 
1092
1094
                                lyr_chn[cidx]->columns,
1093
1095
                                lyr_chn[cidx]->rows);
1094
1096
 
1095
 
              /* Only read channel data if there is more data than
1096
 
               * what compression method that is used
 
1097
              /* Only read channel data if there is any channel
 
1098
               * data. Note that the channel data can contain a
 
1099
               * compression method but no actual data.
1097
1100
               */
1098
 
              if (lyr_a[lidx]->chn_info[cidx].data_len > COMP_MODE_SIZE)
 
1101
              if (lyr_a[lidx]->chn_info[cidx].data_len >= COMP_MODE_SIZE)
1099
1102
                {
1100
 
                  guint16 comp_mode;
1101
 
 
1102
1103
                  if (fread (&comp_mode, COMP_MODE_SIZE, 1, f) < 1)
1103
1104
                    {
1104
1105
                      psd_set_error (feof (f), errno, error);
1106
1107
                    }
1107
1108
                  comp_mode = GUINT16_FROM_BE (comp_mode);
1108
1109
                  IFDBG(3) g_debug ("Compression mode: %d", comp_mode);
1109
 
 
 
1110
                }
 
1111
              if (lyr_a[lidx]->chn_info[cidx].data_len > COMP_MODE_SIZE)
 
1112
                {
1110
1113
                  switch (comp_mode)
1111
1114
                    {
1112
1115
                      case PSD_COMP_RAW:        /* Planar raw data */
1554
1557
      if (img_a->transparency)
1555
1558
        {
1556
1559
          offset = 1;
 
1560
 
1557
1561
          /* Free "Transparency" channel name */
1558
 
          alpha_name = g_ptr_array_index (img_a->alpha_names, 0);
1559
 
          if (alpha_name)
1560
 
            g_free (alpha_name);
 
1562
          if (img_a->alpha_names)
 
1563
            {
 
1564
              alpha_name = g_ptr_array_index (img_a->alpha_names, 0);
 
1565
              if (alpha_name)
 
1566
                g_free (alpha_name);
 
1567
            }
1561
1568
        }
1562
1569
      else
1563
1570
        offset = 0;