kopia lustrzana https://gitlab.com/sane-project/backends
Fixed bug where attempting to change the "image number" in an empty camera
causes a core dump.DEVEL_2_0_BRANCH-1
rodzic
7716aa8409
commit
3746de6c2f
|
@ -126,7 +126,7 @@ static DC240 Camera;
|
||||||
|
|
||||||
static SANE_Range image_range = {
|
static SANE_Range image_range = {
|
||||||
0,
|
0,
|
||||||
14,
|
0,
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -994,10 +994,13 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
|
||||||
Camera.current_picture_number = *(SANE_Word *) value;
|
Camera.current_picture_number = *(SANE_Word *) value;
|
||||||
myinfo |= SANE_INFO_RELOAD_PARAMS;
|
myinfo |= SANE_INFO_RELOAD_PARAMS;
|
||||||
|
|
||||||
/* get the image's resolution */
|
/* get the image's resolution, unless the camera has no
|
||||||
set_res (Camera.
|
* pictures yet
|
||||||
Pictures[Camera.current_picture_number - 1].low_res);
|
*/
|
||||||
|
if ( Camera.pic_taken != 0 ) {
|
||||||
|
set_res (Camera.
|
||||||
|
Pictures[Camera.current_picture_number - 1].low_res);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DC240_OPT_THUMBS:
|
case DC240_OPT_THUMBS:
|
||||||
|
|
Ładowanie…
Reference in New Issue