diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2016-12-11 12:39:27 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2016-12-11 12:39:27 +0000 |
| commit | 7f8613192aeab5ddc7a1003b8c2cc76b8ee8dea2 (patch) | |
| tree | 92db6d4a6f0e012acbae6fcdb0bb6cacbfd9087d | |
| parent | c2ff8d9f44379e5d5480b55fb49ce92ee30b6394 (diff) | |
| download | qmmp-7f8613192aeab5ddc7a1003b8c2cc76b8ee8dea2.tar.gz qmmp-7f8613192aeab5ddc7a1003b8c2cc76b8ee8dea2.tar.bz2 qmmp-7f8613192aeab5ddc7a1003b8c2cc76b8ee8dea2.zip | |
fixed segmentation fault
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@6909 90c681e8-e032-0410-971d-27865f9a5e38
| -rw-r--r-- | src/qmmp/outputwriter.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/qmmp/outputwriter.cpp b/src/qmmp/outputwriter.cpp index 2f5faea23..ce33a04db 100644 --- a/src/qmmp/outputwriter.cpp +++ b/src/qmmp/outputwriter.cpp @@ -275,6 +275,7 @@ void OutputWriter::run() quint64 l; qint64 m = 0; size_t output_at = 0; + unsigned char *tmp = 0; dispatch(Qmmp::Playing); @@ -343,7 +344,15 @@ void OutputWriter::run() m_output_buf = new unsigned char[m_output_size * sampleSize()]; } - m_format_converter->fromFloat(b->data, m_output_buf, b->samples); + if(m_format_converter) + { + m_format_converter->fromFloat(b->data, m_output_buf, b->samples); + tmp = m_output_buf; + } + else + { + tmp = (unsigned char*)b->data; + } output_at = b->samples * m_output->sampleSize(); while (l < output_at && !m_pause && !m_prev_pause) @@ -357,7 +366,7 @@ void OutputWriter::run() break; } mutex()->unlock(); - m = m_output->writeAudio(m_output_buf + l, output_at - l); + m = m_output->writeAudio(tmp + l, output_at - l); if(m >= 0) { m_totalWritten += m; |
