Fixed bug where attempting to change the "image number" in an empty camera

causes a core dump.
DEVEL_2_0_BRANCH-1
Peter Fales 2001-06-07 04:13:36 +00:00
rodzic 7716aa8409
commit 3746de6c2f
1 zmienionych plików z 8 dodań i 5 usunięć

Wyświetl plik

@ -126,7 +126,7 @@ static DC240 Camera;
static SANE_Range image_range = {
0,
14,
0,
0
};
@ -994,10 +994,13 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
Camera.current_picture_number = *(SANE_Word *) value;
myinfo |= SANE_INFO_RELOAD_PARAMS;
/* get the image's resolution */
set_res (Camera.
Pictures[Camera.current_picture_number - 1].low_res);
/* get the image's resolution, unless the camera has no
* pictures yet
*/
if ( Camera.pic_taken != 0 ) {
set_res (Camera.
Pictures[Camera.current_picture_number - 1].low_res);
}
break;
case DC240_OPT_THUMBS: