After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 792596 - v4l2: fix division by 0 for complex video formats
v4l2: fix division by 0 for complex video formats
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-01-17 10:12 UTC by Guillaume Desmottes
Modified: 2018-01-17 18:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
v4l2: display stride and width values if stride is too small (999 bytes, patch)
2018-01-17 10:12 UTC, Guillaume Desmottes
committed Details | Review
v4l2: fix division by 0 for complex video formats (1.47 KB, patch)
2018-01-17 10:12 UTC, Guillaume Desmottes
none Details | Review
v4l2: fix division by 0 for complex video formats (1.67 KB, patch)
2018-01-17 14:23 UTC, Guillaume Desmottes
committed Details | Review

Description Guillaume Desmottes 2018-01-17 10:12:31 UTC
.
Comment 1 Guillaume Desmottes 2018-01-17 10:12:52 UTC
Created attachment 366920 [details] [review]
v4l2: display stride and width values if stride is too small
Comment 2 Guillaume Desmottes 2018-01-17 10:12:59 UTC
Created attachment 366921 [details] [review]
v4l2: fix division by 0 for complex video formats

So complex video formats have 0 as pstride. Don't try to divide the
stride in such cases.
Comment 3 Nicolas Dufresne (ndufresne) 2018-01-17 14:06:20 UTC
Review of attachment 366920 [details] [review]:

Good improvement.
Comment 4 Nicolas Dufresne (ndufresne) 2018-01-17 14:10:55 UTC
Review of attachment 366921 [details] [review]:

I would suggest to add a warning in the else case. Protecting against this crash is great, whenever such format get added, we'll probably want to add per format code to compute the padded width. It is unused in v4l2src atm though, but will be I think when we fix the importation.
Comment 5 Guillaume Desmottes 2018-01-17 14:23:49 UTC
Created attachment 366943 [details] [review]
v4l2: fix division by 0 for complex video formats

So complex video formats have 0 as pstride. Don't try to divide the
stride in such cases.
Comment 6 Nicolas Dufresne (ndufresne) 2018-01-17 18:33:33 UTC
Attachment 366920 [details] pushed as 3bbfd15 - v4l2: display stride and width values if stride is too small
Attachment 366943 [details] pushed as f7e280b - v4l2: fix division by 0 for complex video formats