diff --git a/indi-gphoto/gphoto_ccd.cpp b/indi-gphoto/gphoto_ccd.cpp index 671777ddc..8901fd59b 100644 --- a/indi-gphoto/gphoto_ccd.cpp +++ b/indi-gphoto/gphoto_ccd.cpp @@ -501,7 +501,8 @@ bool GPhotoCCD::ISNewText(const char * dev, const char * name, char * texts[], c return false; char *text = texts[0]; char buf[256]; - if(strcmp("eoszoomposition", name) == 0) { + if(strcmp("eoszoomposition", name) == 0) + { int x = 0, y = 0; LOGF_DEBUG("%s %s", name, text); sscanf(text, "%d,%d", &x, &y); @@ -1569,7 +1570,7 @@ void GPhotoCCD::AddWidget(gphoto_widget * widget) { IPerm perm; - if (!widget) + if (!widget || ((widget->type == GP_WIDGET_RADIO || widget->type == GP_WIDGET_MENU) && widget->choice_cnt > MAX_SWITCHES)) return; perm = widget->readonly ? IP_RO : IP_RW; diff --git a/indi-gphoto/gphoto_ccd.h b/indi-gphoto/gphoto_ccd.h index 00a763f34..04c151dc9 100644 --- a/indi-gphoto/gphoto_ccd.h +++ b/indi-gphoto/gphoto_ccd.h @@ -244,6 +244,8 @@ class GPhotoCCD : public INDI::CCD, public INDI::FocuserInterface static constexpr double FOCUS_HIGH_MED_RATIO = 7.33; // Ratio from far 2 to far 1 static constexpr double FOCUS_MED_LOW_RATIO = 6.36; + // Do not accept switches more than this + static constexpr uint8_t MAX_SWITCHES = 200; friend void ::ISSnoopDevice(XMLEle * root); friend void ::ISGetProperties(const char * dev);