Skip to content

Commit 8b0b38f

Browse files
committed
Merge pull request #100588 from timothyqiu/wild-rid
Betsy: Fix stack-use-after-scope when using BC3 and BC5
2 parents 5ceeff7 + b447eaa commit 8b0b38f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/betsy/image_compress_betsy.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ Error BetsyCompressor::_compress(BetsyFormat p_format, Image *r_img) {
545545
}
546546
}
547547

548-
RID *dst_texture_rid = &dst_texture_primary;
548+
RID dst_texture_rid = dst_texture_primary;
549549

550550
if (needs_alpha_block) {
551551
// Set the destination texture width and size.
@@ -638,21 +638,21 @@ Error BetsyCompressor::_compress(BetsyFormat p_format, Image *r_img) {
638638
compress_rd->sync();
639639
}
640640

641-
dst_texture_rid = &dst_texture_combined;
641+
dst_texture_rid = dst_texture_combined;
642642

643643
compress_rd->free(dst_texture_primary);
644644
compress_rd->free(dst_texture_alpha);
645645
}
646646

647647
// Copy data from the GPU to the buffer.
648-
const Vector<uint8_t> texture_data = compress_rd->texture_get_data(*dst_texture_rid, 0);
648+
const Vector<uint8_t> texture_data = compress_rd->texture_get_data(dst_texture_rid, 0);
649649
int64_t dst_ofs = Image::get_image_mipmap_offset(r_img->get_width(), r_img->get_height(), dest_format, i);
650650

651651
memcpy(dst_data_ptr + dst_ofs, texture_data.ptr(), texture_data.size());
652652

653653
// Free the source and dest texture.
654654
compress_rd->free(src_texture);
655-
compress_rd->free(*dst_texture_rid);
655+
compress_rd->free(dst_texture_rid);
656656
}
657657

658658
src_images.clear();

0 commit comments

Comments
 (0)