rem: if (width <= 0 || height <= 0 || data == NULL || bitmap->locked ||
add: if (width <= 0 || height <= 0 || (x + width) > bitmap->width || (y + height) > bitmap->height || data == NULL || bitmap->locked ||
context: bool glgfx_bitmap_update_a(struct glgfx_bitmap* bitmap, 			   struct glgfx_tagitem const* tags) {  int x = 0, y = 0, width = 0, height = 0;  void* data = NULL;  enum glgfx_pixel_format format = glgfx_pixel_format_unknown;  size_t bytes_per_row = 0;  struct glgfx_tagitem const* tag;  if (bitmap == NULL || tags == NULL) {    return false;  }  while ((tag = glgfx_nexttagitem(&tags)) != NULL) {    switch ((enum glgfx_bitmap_tag) tag->tag) {      case glgfx_bitmap_tag_x:	x = tag->data;	break;      case glgfx_bitmap_tag_y:	y = tag->data;	break;      case glgfx_bitmap_tag_width:	width = tag->data;	break;      case glgfx_bitmap_tag_height:	height = tag->data;	break;      case glgfx_bitmap_tag_data:	data = (void*) tag->data;	break;      case glgfx_bitmap_tag_format:	format = tag->data;	break;      case glgfx_bitmap_tag_bytesperrow:	bytes_per_row = tag->data;	break;      case glgfx_bitmap_tag_bits:      case glgfx_bitmap_tag_friend:      case glgfx_bitmap_tag_unknown:      case glgfx_bitmap_tag_max:	/* Make compiler happy */	break;    }  }  if (width <= 0 || height <= 0 || data == NULL || bitmap->locked ||      format <= glgfx_pixel_format_unknown || format >= glgfx_pixel_format_max) {    return false;  }  if (bytes_per_row == 0) {    bytes_per_row = formats[format].size * width;  }  pthread_mutex_lock(&glgfx_mutex);  glBindTexture(GL_TEXTURE_RECTANGLE_ARB, bitmap->texture);  GLGFX_CHECKERROR();     glPixelStorei(GL_PACK_ROW_LENGTH, bytes_per_row / formats[format].size);  glTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB, 0,		  0, 0, width, height,		  formats[format].format,		  formats[format].type,		  data);  GLGFX_CHECKERROR();  pthread_mutex_unlock(&glgfx_mutex);  return true;}