sane.ds: Check return value from sane_get_option_descriptor().

This commit is contained in:
Lei Zhang 2007-11-09 01:53:07 -08:00 committed by Alexandre Julliard
parent 05907c3e29
commit 84e8ea2fdc
1 changed files with 4 additions and 0 deletions

View File

@ -394,6 +394,8 @@ static LPDLGTEMPLATEW create_options_page(HDC hdc, int *from_index,
int hold_for_group = 0; int hold_for_group = 0;
opt = psane_get_option_descriptor(activeDS.deviceHandle, i); opt = psane_get_option_descriptor(activeDS.deviceHandle, i);
if (!opt)
continue;
if (opt->type == SANE_TYPE_GROUP && split_tabs) if (opt->type == SANE_TYPE_GROUP && split_tabs)
{ {
if (control_len > 0) if (control_len > 0)
@ -407,6 +409,8 @@ static LPDLGTEMPLATEW create_options_page(HDC hdc, int *from_index,
return NULL; return NULL;
} }
} }
if (!SANE_OPTION_IS_ACTIVE (opt->cap))
continue;
len = create_item(hdc, opt, ID_BASE + i, &item_tpl, y, &x, &count); len = create_item(hdc, opt, ID_BASE + i, &item_tpl, y, &x, &count);