if (!glyphsize)
{
FT_Done_Glyph(glyph);
- return EINA_FALSE;
+ goto on_error;
}
buffer_id = cserve2_shared_mempool_buffer_new(response->mempool, glyphsize);
if (!data)
{
FT_Done_Glyph(glyph);
- return EINA_FALSE;
+ goto on_error;
}
memcpy(data, bglyph->bitmap.buffer, glyphsize);
FT_Done_Glyph(glyph);
return EINA_TRUE;
+
+on_error:
+ // Create invalid entry for this index.
+ memset(&response->glyphs[response->nglyphs], 0, sizeof(Slave_Msg_Glyph));
+ response->glyphs[response->nglyphs].index = idx;
+ response->nglyphs++;
+ return EINA_FALSE;
}
static void
int size;
Msg_Error msg;
- // clear the struct with possible paddings, since it is not aligned.
- memset(&msg, 0, sizeof(msg));
- msg.base.rid = rid;
- msg.base.type = CSERVE2_ERROR;
- msg.error = error_code;
-
- size = sizeof(msg);
- cserve2_client_send(client, &size, sizeof(size));
- cserve2_client_send(client, &msg, sizeof(msg));
+ // clear the struct with possible paddings, since it is not aligned.
+ memset(&msg, 0, sizeof(msg));
+ msg.base.rid = rid;
+ msg.base.type = CSERVE2_ERROR;
+ msg.error = error_code;
+
+ size = sizeof(msg);
+ cserve2_client_send(client, &size, sizeof(size));
+ cserve2_client_send(client, &msg, sizeof(msg));
}
void