@next2d/builder 0.1.10 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/README.md +88 -57
  2. package/dist/cli.d.ts +7 -0
  3. package/dist/cli.js +68 -3
  4. package/dist/colors.d.ts +6 -0
  5. package/dist/colors.js +7 -0
  6. package/dist/context.d.ts +10 -1
  7. package/dist/context.js +7 -0
  8. package/dist/description.d.ts +2 -0
  9. package/dist/description.js +8 -0
  10. package/dist/electron-config.d.ts +52 -0
  11. package/dist/electron-config.js +116 -0
  12. package/dist/electron-host.d.ts +5 -0
  13. package/dist/electron-host.js +42 -0
  14. package/dist/electron.d.ts +4 -9
  15. package/dist/electron.js +83 -132
  16. package/dist/index.js +21 -0
  17. package/dist/native.d.ts +9 -24
  18. package/dist/native.js +48 -106
  19. package/dist/project-vite.d.ts +3 -0
  20. package/dist/project-vite.js +21 -0
  21. package/dist/resolve-tool-packages.d.ts +1 -0
  22. package/dist/resolve-tool-packages.js +29 -0
  23. package/dist/steam-upload.d.ts +27 -0
  24. package/dist/steam-upload.js +131 -0
  25. package/dist/steam.d.ts +22 -0
  26. package/dist/steam.js +193 -0
  27. package/dist/tool-packages.d.ts +15 -0
  28. package/dist/tool-packages.js +74 -0
  29. package/dist/web.js +10 -4
  30. package/dist/xbox.d.ts +1 -1
  31. package/dist/xbox.js +60 -57
  32. package/docs/capacitor.md +201 -0
  33. package/docs/steam.md +714 -0
  34. package/docs/xbox.md +145 -0
  35. package/package.json +11 -14
  36. package/templates/electron/entitlements.plist +12 -0
  37. package/templates/electron/icons/icon.icns +0 -0
  38. package/templates/electron/icons/icon.ico +0 -0
  39. package/templates/electron/icons/icon.png +0 -0
  40. package/templates/electron/index.js +95 -0
  41. package/templates/electron/local-assets.cjs +24 -0
  42. package/templates/electron/package.json +11 -0
  43. package/templates/xbox/src/platform/StbTextRasterizer.cpp +14 -10
  44. package/templates/xbox/tests/check_local.sh +12 -4
  45. package/templates/xbox/tests/stb_safety_test.cpp +126 -0
  46. package/templates/xbox/third_party/LICENSES.md +15 -0
  47. package/templates/xbox/third_party/stb_image.h +15 -10
  48. package/templates/xbox/third_party/stb_truetype.h +4 -4
  49. package/templates/xbox/third_party/stb_vorbis.c +1 -1
@@ -1817,7 +1817,8 @@ static stbi__uint16 *stbi__convert_format16(stbi__uint16 *data, int img_n, int r
1817
1817
  if (req_comp == img_n) return data;
1818
1818
  STBI_ASSERT(req_comp >= 1 && req_comp <= 4);
1819
1819
 
1820
- good = (stbi__uint16 *) stbi__malloc(req_comp * x * y * 2);
1820
+ good = (x > INT_MAX || y > INT_MAX) ? NULL :
1821
+ (stbi__uint16 *) stbi__malloc_mad4(req_comp, (int) x, (int) y, 2, 0);
1821
1822
  if (good == NULL) {
1822
1823
  STBI_FREE(data);
1823
1824
  return (stbi__uint16 *) stbi__errpuc("outofmem", "Out of memory");
@@ -4821,7 +4822,7 @@ static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 r
4821
4822
  stbi__create_png_alpha_expand8(dest, dest, x, img_n);
4822
4823
  } else if (depth == 8) {
4823
4824
  if (img_n == out_n)
4824
- memcpy(dest, cur, x*img_n);
4825
+ memcpy(dest, cur, (size_t) x*img_n);
4825
4826
  else
4826
4827
  stbi__create_png_alpha_expand8(dest, cur, x, img_n);
4827
4828
  } else if (depth == 16) {
@@ -6201,7 +6202,7 @@ static void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req
6201
6202
  out = (stbi_uc *) stbi__malloc_mad3(8, w, h, 0);
6202
6203
  ri->bits_per_channel = 16;
6203
6204
  } else
6204
- out = (stbi_uc *) stbi__malloc(4 * w*h);
6205
+ out = (stbi_uc *) stbi__malloc_mad3(4, w, h, 0);
6205
6206
 
6206
6207
  if (!out) return stbi__errpuc("outofmem", "Out of memory");
6207
6208
  pixelCount = w*h;
@@ -6524,7 +6525,7 @@ static void *stbi__pic_load(stbi__context *s,int *px,int *py,int *comp,int req_c
6524
6525
  // intermediate buffer is RGBA
6525
6526
  result = (stbi_uc *) stbi__malloc_mad3(x, y, 4, 0);
6526
6527
  if (!result) return stbi__errpuc("outofmem", "Out of memory");
6527
- memset(result, 0xff, x*y*4);
6528
+ memset(result, 0xff, (size_t) x*y*4);
6528
6529
 
6529
6530
  if (!stbi__pic_load_core(s,x,y,comp, result)) {
6530
6531
  STBI_FREE(result);
@@ -6833,11 +6834,11 @@ static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, i
6833
6834
  }
6834
6835
 
6835
6836
  // background is what out is after the undoing of the previou frame;
6836
- memcpy( g->background, g->out, 4 * g->w * g->h );
6837
+ memcpy( g->background, g->out, (size_t) 4 * g->w * g->h );
6837
6838
  }
6838
6839
 
6839
6840
  // clear my history;
6840
- memset( g->history, 0x00, g->w * g->h ); // pixels that were affected previous frame
6841
+ memset( g->history, 0x00, (size_t) g->w * g->h ); // pixels that were affected previous frame
6841
6842
 
6842
6843
  for (;;) {
6843
6844
  int tag = stbi__get8(s);
@@ -6987,11 +6988,15 @@ static void *stbi__load_gif_main(stbi__context *s, int **delays, int *x, int *y,
6987
6988
  if (u) {
6988
6989
  *x = g.w;
6989
6990
  *y = g.h;
6990
- ++layers;
6991
6991
  stride = g.w * g.h * 4;
6992
+ // Keep the frame count, byte offsets and allocator sizes representable.
6993
+ if (layers == INT_MAX || !stbi__mul2sizes_valid(layers + 1, stride) ||
6994
+ !stbi__mul2sizes_valid(layers + 1, sizeof(int)))
6995
+ return stbi__load_gif_main_outofmem(&g, out, delays);
6996
+ ++layers;
6992
6997
 
6993
6998
  if (out) {
6994
- void *tmp = (stbi_uc*) STBI_REALLOC_SIZED( out, out_size, layers * stride );
6999
+ void *tmp = (stbi_uc*) STBI_REALLOC_SIZED( out, out_size, (size_t) layers * stride );
6995
7000
  if (!tmp)
6996
7001
  return stbi__load_gif_main_outofmem(&g, out, delays);
6997
7002
  else {
@@ -7007,7 +7012,7 @@ static void *stbi__load_gif_main(stbi__context *s, int **delays, int *x, int *y,
7007
7012
  delays_size = layers * sizeof(int);
7008
7013
  }
7009
7014
  } else {
7010
- out = (stbi_uc*)stbi__malloc( layers * stride );
7015
+ out = (stbi_uc*)stbi__malloc( (size_t) layers * stride );
7011
7016
  if (!out)
7012
7017
  return stbi__load_gif_main_outofmem(&g, out, delays);
7013
7018
  out_size = layers * stride;
@@ -7020,7 +7025,7 @@ static void *stbi__load_gif_main(stbi__context *s, int **delays, int *x, int *y,
7020
7025
  }
7021
7026
  memcpy( out + ((layers - 1) * stride), u, stride );
7022
7027
  if (layers >= 2) {
7023
- two_back = out - 2 * stride;
7028
+ two_back = out + (layers - 2) * stride;
7024
7029
  }
7025
7030
 
7026
7031
  if (delays) {
@@ -3739,7 +3739,7 @@ STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info
3739
3739
  if (yoff ) *yoff = iy0;
3740
3740
 
3741
3741
  if (gbm.w && gbm.h) {
3742
- gbm.pixels = (unsigned char *) STBTT_malloc(gbm.w * gbm.h, info->userdata);
3742
+ gbm.pixels = (unsigned char *) STBTT_malloc((size_t) gbm.w * gbm.h, info->userdata);
3743
3743
  if (gbm.pixels) {
3744
3744
  gbm.stride = gbm.w;
3745
3745
 
@@ -3822,7 +3822,7 @@ static int stbtt_BakeFontBitmap_internal(unsigned char *data, int offset, // fo
3822
3822
  f.userdata = NULL;
3823
3823
  if (!stbtt_InitFont(&f, data, offset))
3824
3824
  return -1;
3825
- STBTT_memset(pixels, 0, pw*ph); // background of 0 around pixels
3825
+ STBTT_memset(pixels, 0, (size_t) pw*ph); // background of 0 around pixels
3826
3826
  x=y=1;
3827
3827
  bottom_y = 1;
3828
3828
 
@@ -3981,7 +3981,7 @@ STBTT_DEF int stbtt_PackBegin(stbtt_pack_context *spc, unsigned char *pixels, in
3981
3981
  stbrp_init_target(context, pw-padding, ph-padding, nodes, num_nodes);
3982
3982
 
3983
3983
  if (pixels)
3984
- STBTT_memset(pixels, 0, pw*ph); // background of 0 around pixels
3984
+ STBTT_memset(pixels, 0, (size_t) pw*ph); // background of 0 around pixels
3985
3985
 
3986
3986
  return 1;
3987
3987
  }
@@ -4610,7 +4610,7 @@ STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float sc
4610
4610
  float *precompute;
4611
4611
  stbtt_vertex *verts;
4612
4612
  int num_verts = stbtt_GetGlyphShape(info, glyph, &verts);
4613
- data = (unsigned char *) STBTT_malloc(w * h, info->userdata);
4613
+ data = (unsigned char *) STBTT_malloc((size_t) w * h, info->userdata);
4614
4614
  precompute = (float *) STBTT_malloc(num_verts * sizeof(float), info->userdata);
4615
4615
 
4616
4616
  for (i=0,j=num_verts-1; i < num_verts; j=i++) {
@@ -1401,7 +1401,7 @@ static int set_file_offset(stb_vorbis *f, unsigned int loc)
1401
1401
  #endif
1402
1402
  f->eof = 0;
1403
1403
  if (USE_MEMORY(f)) {
1404
- if (f->stream_start + loc >= f->stream_end || f->stream_start + loc < f->stream_start) {
1404
+ if (loc >= (size_t) (f->stream_end - f->stream_start)) {
1405
1405
  f->stream = f->stream_end;
1406
1406
  f->eof = 1;
1407
1407
  return 0;