Bug 438605 - PATCH: stop pwlib from causing crash when rescaling bayer v4l data to yuv420
PATCH: stop pwlib from causing crash when rescaling bayer v4l data to yuv420
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: pwlib (Show other bugs)
rawhide
All Linux
low Severity low
: ---
: ---
Assigned To: Daniel Veillard
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-03-22 14:53 EDT by Hans de Goede
Modified: 2008-03-27 11:39 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-03-27 11:39:34 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
PATCH: stop pwlib from causing crash when rescaling bayer v4l data to yuv420 (1.36 KB, patch)
2008-03-22 14:53 EDT, Hans de Goede
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
GNOME Desktop 523891 None None None Never

  None (edit)
Description Hans de Goede 2008-03-22 14:53:39 EDT
Hi,

I encountered this crash in ekiga while writing a v4l2 device driver for a
pac207 usb webcam (*). I was testing my driver with ekiga and at first I blamed
my driver, but a few hours later I know better.

ekiga uses pwlib to access webcam's, and pwlib's vconvert.cxx, and converters
from that class should be able to handle both pixelformat changes as scaling. 

However the SBGGR8toYUV420P converter always assumes that the input image and
the output image are the same, without checking this, causing memory corruption
(a buffer overflow) when they differ in size.

This patch fixes this by using the currently #ifdef-ed out slower path when the
sizes differ. It also fixes the (wrongly) swapping of red and blue in this
(before this patch unused) path.

Also filed upstream:
http://bugzilla.gnome.org/show_bug.cgi?id=523891

(*) I know this cam is supported by gspca, thats where I'm getting the info
needed to write the driver for. I'm writing a new standalone v4l2 (no in kernel
bayer -> rgb conversion) driver, which should adhere to all kernel coding
standards, making it suitable for upstream/mainline inclusion.
Comment 1 Hans de Goede 2008-03-22 14:53:39 EDT
Created attachment 298854 [details]
PATCH: stop pwlib from causing crash when rescaling bayer v4l data to yuv420
Comment 2 Daniel Veillard 2008-03-27 11:39:34 EDT
pwlib-1.10.10-6.fc9 has been built with the fix. Not sure if it's worth
pushing a F-8 update,

Daniel

Note You need to log in before you can comment on or make changes to this bug.