Skip to content

Commit

Permalink
fix divide by 0 error
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Jul 5, 2016
1 parent f45954f commit fb2ca6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/AudioFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ AudioFrame::AudioFrame(const AudioFormat &format, const QByteArray& data)
Q_D(AudioFrame);
d->format = format;
d->data = data;
d->samples_per_ch = data.size() / d->format.channels() / d->format.bytesPerSample();
if (!d->format.isValid())
return;
if (d->data.isEmpty())
return;
d->samples_per_ch = data.size() / d->format.channels() / d->format.bytesPerSample();
const int nb_planes(d->format.planeCount());
const int bpl(d->data.size()/nb_planes);
for (int i = 0; i < nb_planes; ++i) {
Expand Down

0 comments on commit fb2ca6e

Please sign in to comment.