← Back to team overview

pkg-perl-maintainers team mailing list archive

[Bug 930552] [NEW] produce broken scan image with snapscan S300 scanner

 

Public bug reported:

As  I described in BTS of gscan2pdf,  https://sourceforge.net/tracker/?func=detail&aid=3485387&group_id=174140&atid=868098
 libsane-perl: Sane.xs have a bug when  length=0 is returned from backend while sane_read().
It is occured with epjitsu backend driver that is used for Fujitsu SnapScan S300 scanner.

Sane.xs:
------------------
void
sane_read (handle, max_length)
		SANE_Handle	handle
		SANE_Int	max_length
	INIT:
		SANE_Status	status;
                SANE_Byte *	data;
                SANE_Int	length;
        PPCODE:
		data = malloc (max_length);
		status = sane_read (handle, data, max_length, &length);
       		SV* sv = get_sv("Sane::_status", FALSE);
                sv_setiv(sv, status); 
                if (status) {
                	XPUSHs(sv_2mortal(newSV(0)));
                	XPUSHs(sv_2mortal(newSViv(0)));
                }
                else {
                	XPUSHs(sv_2mortal(newSVpv(data, length)));
			XPUSHs(sv_2mortal(newSViv(length)));
                }
                free (data);
--------------
when call newSVpv(data, length) with length=0, that means 'auto detect length of string of data'.
But length=0  should treat as   'no data'.

If  (const char *)data consist by other than '\0', it happens that no-
needed bytes is returned.

That is happend with S300 scaner and gscan2pdf, scanimage-perl, and
scanadf-perl utilities.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: libsane-perl 0.03-1build1
ProcVersionSignature: Ubuntu 3.0.0-15.26-generic 3.0.13
Uname: Linux 3.0.0-15-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 1.23-0ubuntu4
Architecture: amd64
Date: Sat Feb 11 15:31:17 2012
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release amd64 (20100429)
ProcEnviron:
 PATH=(custom, user)
 LANG=ja_JP.UTF-8
 SHELL=/bin/bash
SourcePackage: libsane-perl
UpgradeStatus: Upgraded to oneiric on 2011-12-24 (49 days ago)

** Affects: libsane-perl (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug oneiric running-unity

-- 
You received this bug notification because you are a member of Debian
Perl Group, which is subscribed to libsane-perl in Ubuntu.
https://bugs.launchpad.net/bugs/930552

Title:
  produce broken scan image with snapscan S300 scanner

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libsane-perl/+bug/930552/+subscriptions


Follow ups

References