Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[paplayer] Prevent possible division by zero in MP3Codec. #4364

Merged
merged 1 commit into from

3 participants

@ace20022
Collaborator

No description provided.

@MartijnKaijser MartijnKaijser added this to the Gotham13.0-beta2 milestone
@jmarshallnz jmarshallnz merged commit f03059d into xbmc:Gotham
@jmarshallnz
Owner

Thanks :)

@jmarshallnz jmarshallnz added Gotham and removed Gotham labels
@ace20022 ace20022 deleted the ace20022:pap_zero_gotham branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 3 deletions.
  1. +4 −3 xbmc/cores/paplayer/MP3codec.cpp
View
7 xbmc/cores/paplayer/MP3codec.cpp
@@ -886,13 +886,14 @@ int MP3Codec::ReadDuration()
double tpfbs[] = { 0, 384.0f, 1152.0f, 1152.0f };
frequency = freqtab[version][freqindex];
- tpf = tpfbs[layer] / (double) frequency;
- if (version == MPEG_VERSION2_5 || version == MPEG_VERSION2)
- tpf /= 2;
if (frequency == 0)
return 0;
+ tpf = tpfbs[layer] / (double) frequency;
+ if (version == MPEG_VERSION2_5 || version == MPEG_VERSION2)
+ tpf /= 2;
+
/* Channel mode (stereo/mono) */
int chmode = (mpegheader & 0xc0) >> 6;
/* calculate position of Xing VBR header */
Something went wrong with that request. Please try again.