mirror of https://github.com/ArduPilot/ardupilot
AP_OSD: don't panic on bad font num in SITL
This commit is contained in:
parent
af6c5ebda1
commit
6eb00b92fd
|
@ -46,6 +46,11 @@ void AP_OSD_SITL::load_font(void)
|
|||
last_font = get_font_num();
|
||||
fontname[4] = last_font + '0';
|
||||
uint8_t *font_data = AP_ROMFS::find_decompress(fontname, font_size);
|
||||
if (font_data == nullptr && last_font != 0) {
|
||||
last_font = 0;
|
||||
fontname[4] = last_font + '0';
|
||||
font_data = AP_ROMFS::find_decompress(fontname, font_size);
|
||||
}
|
||||
if (font_data == nullptr || font_size != 54 * 256) {
|
||||
AP_HAL::panic("Bad font file");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue