Image abnmormally stretched when streaming with transcode activated (Integer overflow in aspect ratio calculation)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
VLC media player |
Fix Released
|
Unknown
|
|||
vlc (Debian) |
Fix Released
|
Unknown
|
|||
vlc (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Maverick |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Binary package hint: vlc
Using VLC 1.1.4-1 on Ubuntu 10.10. When I try to stream and transcode from capturing with a webcam, the image in the stream is always stretched vertically. Note that if I select to stream without transcoding, the image, in either case, looks normal. Please keep in mind that this bug seems to be only reproducible with Ubuntu. In Windows everything works as expected. I tried several webcams, with similar results. As it is, streaming from a capture device like a webcam is completely unusable.
The cause of the bug (a comprehensive description is given in the upstream report) is due to a integer overflow during transcoding. Basically, the aspect ratio for a 640x320 webcam is given in absolute terms, for example 276480000:276480000 which is equivalent to 1:1, but when multiplied by 640 the result is > 32 bits.
The attached patch essentially prevents the overflow by reducing the value of the aspect ratio within 32 bit and by assigning a working value for the aspect ratio of the image after decoding.
TEST CASE to reproduce:
0. Make sure you have a webcam attached.
1. Launch vlc
2. press CTRL+C for capture from the webcam using v4l2
3. press ALT+S for streaming
4. select stream to a file (but http will do also)
5. Important: make sure you select a transcoding option. Anyone is
good, other than OGG (where this bug seem not to apply).
6. Start the stream and wait a few minutes, before turning the stream OFF.
Expected: the file (or http stream) should have an image with the
correct aspect ratio.
Actual: the video is deformed (in my case vertically elongated.
The patch has been extensively tested on test builds on VLC 1.1.4-1ubuntu1 in maverick. No collateral effects are expected.
Changed in vlc: | |
status: | Unknown → Confirmed |
summary: |
- Image abnmormally stretched when streaming with transcode activated. + Image abnmormally stretched when streaming with transcode activated + (Integer overflow in aspect ratio calculation) |
Changed in vlc (Ubuntu): | |
status: | New → Confirmed |
status: | Confirmed → In Progress |
status: | In Progress → Fix Committed |
status: | Fix Committed → Confirmed |
Changed in vlc (Debian): | |
status: | Unknown → New |
Changed in vlc: | |
status: | Confirmed → Fix Released |
Changed in vlc (Ubuntu Maverick): | |
assignee: | Micah Gersten (micahg) → nobody |
tags: |
added: verification-done removed: verification-needed |
Changed in vlc (Debian): | |
status: | New → Fix Released |
tags: | added: testcase |
Images depicting the abnormal behaviour attached to the upstream bug report:
https:/ /trac.videolan. org/vlc/ ticket/ 4312