Fix out of bound access

pull/5656/head
Kim Kulling 2024-07-05 15:08:59 +02:00
parent 6706652592
commit 4c7a39d1d0
1 changed files with 1 additions and 1 deletions

View File

@ -224,7 +224,7 @@ size_t AMFImporter::PostprocessHelper_GetTextureID_Or_Create(const std::string &
}
// Create format hint.
strncpy(converted_texture.FormatHint, "rgba0000", 8); // copy initial string.
strncpy(converted_texture.FormatHint, "rgba", 4); // copy initial string.
if (!r.empty()) converted_texture.FormatHint[4] = '8';
if (!g.empty()) converted_texture.FormatHint[5] = '8';
if (!b.empty()) converted_texture.FormatHint[6] = '8';