bug 966021 - fix load_truetype_table in the cairo dwrite font backend. r=bas

This commit is contained in:
Jonathan Kew 2014-02-01 09:24:58 +00:00
parent 1f07d87838
commit 8b89967b1d

View File

@ -1052,10 +1052,12 @@ _cairo_dwrite_load_truetype_table(void *scaled_font,
return CAIRO_INT_STATUS_UNSUPPORTED;
}
*length = size;
if (buffer) {
memcpy(buffer, data, size);
if (buffer && *length && (UINT32)offset < size) {
size = MIN(size - (UINT32)offset, *length);
memcpy(buffer, (const char*)data + offset, size);
}
*length = size;
if (tableContext) {
face->dwriteface->ReleaseFontTable(tableContext);
}