Skip to content
Snippets Groups Projects
Commit 0dd04d07 authored by edgomez's avatar edgomez Committed by Jean-Baptiste Kempf
Browse files

dshow: prevent division by zero

# HG changeset patch
# User Edouard Gomez <ed.gomez@free.fr>
# Date 1224021633 -7200
# Node ID 9564c1736b76c96f37fb85476d36496b3d7955bb
# Parent  40d5c2186f7fb31e944b5b542b3366bbc420cc0e
dshow: prevent division by zero

In the DShow capture module, division by zero is possible in
multiple modulo statements when dealing with granularity values
returned by capture filters.

Change the code so that:
 - if granularity is zero, then width/height/samplingrate must be
   a perfect match with requested settings.
 - if granularity is non zero, then use the old condition tests.

This fixes real crashes reported by VLC users on different forums.

See:
http://forum.doom9.org/archive/index.php/t-134655.html
http://forum.videolan.org/viewtopic.php?f=2&t=37056&p=114065&hilit=blackmagic



Tested with both a Decklink HD Extreme card and a Decklink HD Pro card.

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent b58e4bab
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment