umax: initialize reader_pid early in sane_start()

This avoids that subsequent errors followed by do_cancel() attempt to
phtread_cancel() an invalid thread (which may cause a crash).
merge-requests/1/head
Nils Philippsen 2013-01-16 11:57:37 +01:00
rodzic 1cf7b1d5e5
commit defdc1ab5c
1 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

@ -7285,6 +7285,10 @@ SANE_Status sane_start(SANE_Handle handle)
DBG(DBG_sane_init,"sane_start\n");
/* Initialize reader_pid to invalid so a subsequent error and following call
* to do_cancel() won't trip over it. */
scanner->reader_pid = -1;
mode = scanner->val[OPT_MODE].s;
if (scanner->device->sfd == -1) /* first call, don`t run this routine again on multi frame or multi image scan */