Browse Source

Fixed error: 'srcpixel' may be used uninitialized

Sam Lantinga 4 months ago
parent
commit
294beceec7
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/render/software/SDL_triangle.c

+ 1 - 0
src/render/software/SDL_triangle.c

@@ -802,6 +802,7 @@ static void SDL_BlitTriangle_Slow(SDL_BlitInfo *info,
         TRIANGLE_GET_TEXTCOORD
         TRIANGLE_GET_TEXTCOORD
         src = (info->src + (srcy * info->src_pitch) + (srcx * srcbpp));
         src = (info->src + (srcy * info->src_pitch) + (srcx * srcbpp));
         if (FORMAT_INDEXED(srcfmt_val)) {
         if (FORMAT_INDEXED(srcfmt_val)) {
+            srcpixel = *src;
             const SDL_Color *color = &palette->colors[*src];
             const SDL_Color *color = &palette->colors[*src];
             srcR = color->r;
             srcR = color->r;
             srcG = color->g;
             srcG = color->g;