Commit 2336f1c
committed
gfx/video_shader_parse: accept float values for absolute scale_x/y
Many community .slangp presets — notably Mega_Bezel — write absolute
scale dimensions as floats, e.g.
scale_type_x26 = absolute
scale_x26 = 800.0
Before commit 1d9ed2e ("file/config_file: reject non-numeric input in
integer getters"), config_get_int silently accepted "800.0" as 800
because strtol stops at the '.', returns 800, and leaves errno == 0.
The old getter only checked errno, so it returned true with *in = 800.
After 1d9ed2e — correctly — config_get_int rejects strings with
trailing garbage and leaves *in untouched. In video_shader_parse_pass
the local iattr is initialised to 0 but scale->abs_x / abs_y are not
assigned on failure, so the absolute-scaled passes end up with a 0
dimension. The Vulkan driver then tries to build a 0×N (or 0×0)
framebuffer and crashes.
Fall back to config_get_float + roundf on the absolute branches so
the long-tail of presets using float-shaped absolute scales keeps
working without resurrecting the silent-accept behaviour in
config_file.
Hopefully fixes #18981.1 parent 64949e7 commit 2336f1c
1 file changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
779 | 780 | | |
780 | 781 | | |
781 | 782 | | |
| 783 | + | |
782 | 784 | | |
783 | 785 | | |
| 786 | + | |
| 787 | + | |
784 | 788 | | |
785 | 789 | | |
786 | 790 | | |
787 | 791 | | |
788 | 792 | | |
789 | 793 | | |
| 794 | + | |
| 795 | + | |
790 | 796 | | |
791 | 797 | | |
792 | 798 | | |
| |||
809 | 815 | | |
810 | 816 | | |
811 | 817 | | |
| 818 | + | |
812 | 819 | | |
813 | 820 | | |
| 821 | + | |
| 822 | + | |
814 | 823 | | |
815 | 824 | | |
816 | 825 | | |
817 | 826 | | |
818 | 827 | | |
819 | 828 | | |
| 829 | + | |
| 830 | + | |
820 | 831 | | |
821 | 832 | | |
822 | 833 | | |
| |||
0 commit comments