Revert "Imported Upstream version 1.2.7"
[platform/upstream/harfbuzz.git] / src / hb-blob.cc
index fb48f03..8759a25 100644 (file)
@@ -91,7 +91,7 @@ _hb_blob_destroy_user_data (hb_blob_t *blob)
  * Return value: New blob, or the empty blob if something failed or if @length is
  * zero.  Destroy with hb_blob_destroy().
  *
- * Since: 0.9.2
+ * Since: 1.0
  **/
 hb_blob_t *
 hb_blob_create (const char        *data,
@@ -104,6 +104,7 @@ hb_blob_create (const char        *data,
 
   if (!length ||
       length >= 1u << 31 ||
+      data + length < data /* overflows */ ||
       !(blob = hb_object_create<hb_blob_t> ())) {
     if (destroy)
       destroy (user_data);
@@ -146,7 +147,7 @@ hb_blob_create (const char        *data,
  * @length is zero or @offset is beyond the end of @parent's data.  Destroy
  * with hb_blob_destroy().
  *
- * Since: 0.9.2
+ * Since: 1.0
  **/
 hb_blob_t *
 hb_blob_create_sub_blob (hb_blob_t    *parent,
@@ -178,7 +179,7 @@ hb_blob_create_sub_blob (hb_blob_t    *parent,
  *
  * Return value: (transfer full): the empty blob.
  *
- * Since: 0.9.2
+ * Since: 1.0
  **/
 hb_blob_t *
 hb_blob_get_empty (void)
@@ -209,7 +210,7 @@ hb_blob_get_empty (void)
  *
  * Return value: @blob.
  *
- * Since: 0.9.2
+ * Since: 1.0
  **/
 hb_blob_t *
 hb_blob_reference (hb_blob_t *blob)
@@ -227,7 +228,7 @@ hb_blob_reference (hb_blob_t *blob)
  *
  * See TODO:link object types for more information.
  *
- * Since: 0.9.2
+ * Since: 1.0
  **/
 void
 hb_blob_destroy (hb_blob_t *blob)
@@ -249,7 +250,7 @@ hb_blob_destroy (hb_blob_t *blob)
  *
  * Return value: 
  *
- * Since: 0.9.2
+ * Since: 1.0
  **/
 hb_bool_t
 hb_blob_set_user_data (hb_blob_t          *blob,
@@ -270,7 +271,7 @@ hb_blob_set_user_data (hb_blob_t          *blob,
  *
  * Return value: (transfer none): 
  *
- * Since: 0.9.2
+ * Since: 1.0
  **/
 void *
 hb_blob_get_user_data (hb_blob_t          *blob,
@@ -286,7 +287,7 @@ hb_blob_get_user_data (hb_blob_t          *blob,
  *
  * 
  *
- * Since: 0.9.2
+ * Since: 1.0
  **/
 void
 hb_blob_make_immutable (hb_blob_t *blob)
@@ -305,7 +306,7 @@ hb_blob_make_immutable (hb_blob_t *blob)
  *
  * Return value: TODO
  *
- * Since: 0.9.2
+ * Since: 1.0
  **/
 hb_bool_t
 hb_blob_is_immutable (hb_blob_t *blob)
@@ -322,7 +323,7 @@ hb_blob_is_immutable (hb_blob_t *blob)
  *
  * Return value: the length of blob data in bytes.
  *
- * Since: 0.9.2
+ * Since: 1.0
  **/
 unsigned int
 hb_blob_get_length (hb_blob_t *blob)
@@ -339,7 +340,7 @@ hb_blob_get_length (hb_blob_t *blob)
  *
  * Returns: (transfer none) (array length=length): 
  *
- * Since: 0.9.2
+ * Since: 1.0
  **/
 const char *
 hb_blob_get_data (hb_blob_t *blob, unsigned int *length)
@@ -364,7 +365,7 @@ hb_blob_get_data (hb_blob_t *blob, unsigned int *length)
  * Returns: (transfer none) (array length=length): Writable blob data,
  * or %NULL if failed.
  *
- * Since: 0.9.2
+ * Since: 1.0
  **/
 char *
 hb_blob_get_data_writable (hb_blob_t *blob, unsigned int *length)