Ticket #25909: patch-base_gsfcmap.c.diff

File patch-base_gsfcmap.c.diff, 791 bytes (added by vinc17@…, 14 years ago)

patch fixing the bug

  • base/gsfcmap.c

     
    500500            break;
    501501    }
    502502    penum->index[1] = j;
     503    if (i > 255) {
    503504    penum->entry.key[0][0] = (uchar)(i >> 8);
    504505    penum->entry.key[0][cmap->key_size - 1] = (uchar)(i & 0xFF);
    505506    penum->entry.key[1][0] = (uchar)(j >> 8);
    506507    penum->entry.key[1][cmap->key_size - 1] = (uchar)((j - 1) & 0xFF);
    507508    memcpy(penum->temp_value, map + i * gs_cmap_ToUnicode_code_bytes,
    508509                        gs_cmap_ToUnicode_code_bytes);
     510    } else {
     511        penum->entry.key[0][0] = (uchar)(i);
     512        penum->entry.key[1][0] = (uchar)(j-1);
     513        penum->entry.key_size = 1;
     514        memcpy(penum->temp_value, map + i * gs_cmap_ToUnicode_code_bytes,
     515                        gs_cmap_ToUnicode_code_bytes);
     516    }
    509517    return 0;
    510518}
    511519