ultravideo / uvg266

An open-source VVC encoder based on Kvazaar
BSD 3-Clause "New" or "Revised" License
225 stars 16 forks source link

[10bit] don't overwrite heap #21

Closed Jamaika1 closed 3 months ago

Jamaika1 commented 3 months ago
transform.c: In function 'uvg_chroma_transform_search':
transform.c:717:31: warning: passing argument 2 of 'uvg_pixels_blit' from incompatible pointer type [-Wincompatible-pointer-types]
  717 |       uvg_pixels_blit(u_pred, &u_recon[trans_offset * i], width, height, width, width);
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                               |
      |                               uint8_t * {aka unsigned char *}
In file included from cu.h:42,
                 from transform.h:41,
                 from transform.c:33:
image.h:118:56: note: expected 'uvg_pixel *' {aka 'short unsigned int *'} but argument is of type 'uint8_t *' {aka 'unsigned char *'}
  118 | void uvg_pixels_blit(const uvg_pixel* orig, uvg_pixel *dst,
      |                                             ~~~~~~~~~~~^~~
transform.c:758:31: warning: passing argument 2 of 'uvg_pixels_blit' from incompatible pointer type [-Wincompatible-pointer-types]
  758 |       uvg_pixels_blit(v_pred, &v_recon[trans_offset * i], width, height, width, width);
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                               |
      |                               uint8_t * {aka unsigned char *}
In file included from cu.h:42,
                 from transform.h:41,
                 from transform.c:33:
image.h:118:56: note: expected 'uvg_pixel *' {aka 'short unsigned int *'} but argument is of type 'uint8_t *' {aka 'unsigned char *'}
  118 | void uvg_pixels_blit(const uvg_pixel* orig, uvg_pixel *dst,
      |                                             ~~~~~~~~~~~^~~
transform.c:762:56: warning: passing argument 2 of 'uvg_pixels_calc_ssd' from incompatible pointer type [-Wincompatible-pointer-types]
  762 |       ssd_u = uvg_pixels_calc_ssd(&lcu->ref.u[offset], &u_recon[trans_offset * i],
      |                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                        |
      |                                                        uint8_t * {aka unsigned char *}
transform.c:762:56: note: expected 'const uvg_pixel * const' {aka 'const short unsigned int * const'} but argument is of type 'uint8_t *' {aka 'unsigned char *'}
transform.c:765:56: warning: passing argument 2 of 'uvg_pixels_calc_ssd' from incompatible pointer type [-Wincompatible-pointer-types]
  765 |       ssd_v = uvg_pixels_calc_ssd(&lcu->ref.v[offset], &v_recon[trans_offset * i],
      |                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                        |
      |                                                        uint8_t * {aka unsigned char *}
transform.c:765:56: note: expected 'const uvg_pixel * const' {aka 'const short unsigned int * const'} but argument is of type 'uint8_t *' {aka 'unsigned char *'}
Jovasa commented 3 months ago

The type should be uvg_pixel, that already encompasses the preprocessor macros.

Jovasa commented 3 months ago

Can you just do this in one commit?