summaryrefslogtreecommitdiffstats
path: root/apps/pcmbuf.c
diff options
context:
space:
mode:
authorSteve Bavin <pondlife@pondlife.me>2009-11-26 14:41:31 +0000
committerSteve Bavin <pondlife@pondlife.me>2009-11-26 14:41:31 +0000
commitb2dc7f004ef2a9fe81d93acc7810ed16bebb42f6 (patch)
treeefa335ba4f774d95f131548044f91c438fa2a14a /apps/pcmbuf.c
parentee7cf6c63c67222dcf9af6f40098428c577ee775 (diff)
downloadrockbox-b2dc7f004ef2a9fe81d93acc7810ed16bebb42f6.tar.gz
rockbox-b2dc7f004ef2a9fe81d93acc7810ed16bebb42f6.tar.bz2
rockbox-b2dc7f004ef2a9fe81d93acc7810ed16bebb42f6.zip
Fix crash when crossfading at natural track transition - FS#10814
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23758 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/pcmbuf.c')
-rw-r--r--apps/pcmbuf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c
index 04e007f91d..ebb058cf87 100644
--- a/apps/pcmbuf.c
+++ b/apps/pcmbuf.c
@@ -722,6 +722,9 @@ static size_t find_chunk(size_t length, struct chunkdesc **chunk)
static size_t crossfade_mix_fade(int factor, size_t length, const char *buf,
size_t *out_sample, struct chunkdesc **out_chunk)
{
+ if (length == 0)
+ return 0;
+
const int16_t *input_buf = (const int16_t *)buf;
int16_t *output_buf = (int16_t *)((*out_chunk)->addr);
int16_t *chunk_end = SKIPBYTES(output_buf, (*out_chunk)->size);