mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-10-31 13:11:05 +01:00 
			
		
		
		
	Fix infinite loop in ImFontGlyphRangesBuilder::AddRanges if the user passes upper range = UINT16_MAX without IMGUI_USE_WCHAR32. (#4802)
This commit is contained in:
		| @@ -88,6 +88,8 @@ Other Changes: | |||||||
| - Clipper: fixed invalid state when number of frozen table row is smaller than ItemCount. | - Clipper: fixed invalid state when number of frozen table row is smaller than ItemCount. | ||||||
| - Drag and Drop: BeginDragDropSource() with ImGuiDragDropFlags_SourceAllowNullID doesn't lose | - Drag and Drop: BeginDragDropSource() with ImGuiDragDropFlags_SourceAllowNullID doesn't lose | ||||||
|   tooltip when scrolling. (#143) |   tooltip when scrolling. (#143) | ||||||
|  | - Fonts: fixed infinite loop in ImFontGlyphRangesBuilder::AddRanges() when passing UINT16_MAX without | ||||||
|  |   the IMGUI_USE_WCHAR32 compile-time option. (#4802) [@SlavicPotato] | ||||||
| - Metrics: Added a node showing windows in submission order and showing the Begin() stack. | - Metrics: Added a node showing windows in submission order and showing the Begin() stack. | ||||||
| - Misc: Added missing ImGuiMouseCursor_NotAllowed cursor for software rendering (when the | - Misc: Added missing ImGuiMouseCursor_NotAllowed cursor for software rendering (when the | ||||||
|   io.MouseDrawCursor flag is enabled). (#4713) [@nobody-special666] |   io.MouseDrawCursor flag is enabled). (#4713) [@nobody-special666] | ||||||
|   | |||||||
| @@ -3080,8 +3080,8 @@ void ImFontGlyphRangesBuilder::AddText(const char* text, const char* text_end) | |||||||
| void ImFontGlyphRangesBuilder::AddRanges(const ImWchar* ranges) | void ImFontGlyphRangesBuilder::AddRanges(const ImWchar* ranges) | ||||||
| { | { | ||||||
|     for (; ranges[0]; ranges += 2) |     for (; ranges[0]; ranges += 2) | ||||||
|         for (ImWchar c = ranges[0]; c <= ranges[1]; c++) |         for (unsigned int c = ranges[0]; c <= ranges[1] && c <= IM_UNICODE_CODEPOINT_MAX; c++) | ||||||
|             AddChar(c); |             AddChar((ImWchar)c); | ||||||
| } | } | ||||||
|  |  | ||||||
| void ImFontGlyphRangesBuilder::BuildRanges(ImVector<ImWchar>* out_ranges) | void ImFontGlyphRangesBuilder::BuildRanges(ImVector<ImWchar>* out_ranges) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user