From 1e0303b1a384cf8b614155d57b639b06923cc28d Mon Sep 17 00:00:00 2001 From: Chris Moeller Date: Mon, 21 Oct 2013 00:40:35 -0700 Subject: [PATCH] Fix possible serious error which could result in overrunning the caller's buffer --- Plugins/Musepack/MusepackDecoder.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Musepack/MusepackDecoder.m b/Plugins/Musepack/MusepackDecoder.m index 6d259d7eb..622f862ba 100644 --- a/Plugins/Musepack/MusepackDecoder.m +++ b/Plugins/Musepack/MusepackDecoder.m @@ -163,7 +163,7 @@ mpc_bool_t CanSeekProc(void *data) framesToRead = frames; } - [self writeToBuffer:((float*)(buf + (framesRead*bytesPerFrame))) fromBuffer:sampleBuffer frames: bufferFrames]; + [self writeToBuffer:((float*)(buf + (framesRead*bytesPerFrame))) fromBuffer:sampleBuffer frames: framesToRead]; frames -= framesToRead; framesRead += framesToRead;