summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorvoroshil <voroshil@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-09-24 20:30:06 +0000
committervoroshil <voroshil@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-09-24 20:30:06 +0000
commit89600cd4cada025cc153e19d2da472f61b212499 (patch)
tree5d59a74a8cd57776560274372d0bdcc752933da2 /stream
parenta1f7b4aef9b891de9f8c568bf0cd77e8370f1487 (diff)
downloadmpv-89600cd4cada025cc153e19d2da472f61b212499.tar.bz2
mpv-89600cd4cada025cc153e19d2da472f61b212499.tar.xz
Fix overflow in frequency conversion code inside tvi_dshow.
patch from Laurent laurent dot aml at gmail dot com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27660 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r--stream/tvi_dshow.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/stream/tvi_dshow.c b/stream/tvi_dshow.c
index 438ce7288f..abfd0b53d0 100644
--- a/stream/tvi_dshow.c
+++ b/stream/tvi_dshow.c
@@ -3478,7 +3478,7 @@ static int control(priv_t * priv, int cmd, void *arg)
return TVI_CONTROL_FALSE;
ret = get_frequency(priv, &lFreq);
- lFreq = lFreq * 16 / 1000000; //convert from Hz to 1/16 MHz units
+ lFreq = lFreq / (1000000/16); //convert from Hz to 1/16 MHz units
*(unsigned long *) arg = lFreq;
return ret;
@@ -3489,7 +3489,7 @@ static int control(priv_t * priv, int cmd, void *arg)
if (!priv->pTVTuner)
return TVI_CONTROL_FALSE;
//convert to Hz
- nFreq = 1000000 * nFreq / 16; //convert from 1/16 MHz units to Hz
+ nFreq = (1000000/16) * nFreq; //convert from 1/16 MHz units to Hz
return set_frequency(priv, nFreq);
}
case TVI_CONTROL_VID_SET_HUE: