From 4e06aca2271e2dbdd93183573eec82a7ca6efe442b5405778cc484e6b150ae86 Mon Sep 17 00:00:00 2001 From: Michal Seben Date: Wed, 7 Sep 2011 08:59:01 +0000 Subject: [PATCH] Accepting request 81186 from home:mseben:branches:multimedia:apps added patch audacity-1.3.13-div_by_zero_fix.patch to fix crash OBS-URL: https://build.opensuse.org/request/show/81186 OBS-URL: https://build.opensuse.org/package/show/multimedia:apps/audacity?expand=0&rev=54 --- audacity-1.3.13-div_by_zero_fix.patch | 82 +++++++++++++++++++++++++++ audacity.changes | 6 ++ audacity.spec | 3 + 3 files changed, 91 insertions(+) create mode 100644 audacity-1.3.13-div_by_zero_fix.patch diff --git a/audacity-1.3.13-div_by_zero_fix.patch b/audacity-1.3.13-div_by_zero_fix.patch new file mode 100644 index 0000000..62b689b --- /dev/null +++ b/audacity-1.3.13-div_by_zero_fix.patch @@ -0,0 +1,82 @@ +--- src/widgets/ProgressDialog.cpp 2011-04-07 01:35:50.000000000 +0200 ++++ src/widgets/ProgressDialog.cpp 2011-09-04 21:49:20.956000014 +0200 +@@ -1338,7 +1338,14 @@ + int + ProgressDialog::Update(wxULongLong_t current, wxULongLong_t total, const wxString & message) + { +- return Update((int)(current * 1000 / total), message); ++ if (total != 0) ++ { ++ return Update((int)(current * 1000 / total), message); ++ } ++ else ++ { ++ return Update(1000, message); ++ } + } + + // +@@ -1347,7 +1354,14 @@ + int + ProgressDialog::Update(wxLongLong current, wxLongLong total, const wxString & message) + { +- return Update((int)(current.GetValue() * 1000ll / total.GetValue()), message); ++ if (total.GetValue() != 0) ++ { ++ return Update((int)(current.GetValue() * 1000ll / total.GetValue()), message); ++ } ++ else ++ { ++ return Update(1000, message); ++ } + } + + // +@@ -1356,7 +1370,14 @@ + int + ProgressDialog::Update(wxLongLong_t current, wxLongLong_t total, const wxString & message) + { +- return Update((int)(current * 1000ll / total), message); ++ if (total != 0) ++ { ++ return Update((int)(current * 1000ll / total), message); ++ } ++ else ++ { ++ return Update(1000, message); ++ } + } + + // +@@ -1365,7 +1386,14 @@ + int + ProgressDialog::Update(int current, int total, const wxString & message) + { +- return Update((int)(current * ((double)(1000.0 / total))), message); ++ if (total != 0) ++ { ++ return Update((int)(current * ((double)(1000.0 / total))), message); ++ } ++ else ++ { ++ return Update(1000, message); ++ } + } + + // +@@ -1374,7 +1402,14 @@ + int + ProgressDialog::Update(double current, double total, const wxString & message) + { +- return Update((int)(current * 1000.0 / total), message); ++ if (total != 0) ++ { ++ return Update((int)(current * 1000.0 / total), message); ++ } ++ else ++ { ++ return Update(1000, message); ++ } + } + + // diff --git a/audacity.changes b/audacity.changes index e9070d4..ca050d7 100644 --- a/audacity.changes +++ b/audacity.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Sep 7 07:36:18 UTC 2011 - mseben@gmail.com + +- added audacity-1.3.13-div_by_zero_fix.patch to fix audacity crash + while opening invalid wav file (bnc#711737) + ------------------------------------------------------------------- Fri Aug 19 19:47:51 UTC 2011 - reddwarf@opensuse.org diff --git a/audacity.spec b/audacity.spec index c914943..4ad13a3 100644 --- a/audacity.spec +++ b/audacity.spec @@ -64,6 +64,8 @@ Source1: %{name}.png Source2: %{name}-license-nyquist # PATCH-FIX-OPENSUSE %{name}-no_buildstamp.patch reddwarf@opensuse.org -- this patch removes the buildstamp Patch0: %{name}-no_buildstamp.patch +# PATCH-FIX-UPSTREAM %{name}-1.3.13-div_by_zero_fix.patch mseben@gmail.com -- fix crash (bnc#711737), fix already in upstream svn +Patch1: %{name}-1.3.13-div_by_zero_fix.patch Patch16: %{name}-implicit.patch # PATCH-FIX-UPSTREAM %{name}-1.3.13-ffmpeg.patch reddwarf@opensuse.org -- make it compile against latest ffmpeg Patch17: %{name}-1.3.13-ffmpeg.patch @@ -83,6 +85,7 @@ physical memory size of your computer. %prep %setup -q -n %{name}-src-%{version}-beta %patch0 +%patch1 %patch16 %if %{with ffmpeg} %patch17 -p1