aboutsummaryrefslogtreecommitdiffhomepage
path: root/libmpcodecs
diff options
context:
space:
mode:
authorGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-09-12 21:08:04 +0000
committerGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-09-12 21:08:04 +0000
commit2737167ecfbb67fe26c7e3787d8c494e1043796b (patch)
tree66b83fb0f1ce5731240e2ad6d5e3343e46f8e6f4 /libmpcodecs
parentce93d8e31ac8b7c2239b0826bcf8008e2d1c4c3a (diff)
Fix maximum frame size, could lead to crashes when changing playback speed.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16469 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/ad_mpc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libmpcodecs/ad_mpc.c b/libmpcodecs/ad_mpc.c
index 3593bc1d5f..4a045c1377 100644
--- a/libmpcodecs/ad_mpc.c
+++ b/libmpcodecs/ad_mpc.c
@@ -29,7 +29,8 @@ LIBAD_EXTERN(libmusepack)
#include <mpcdec/mpcdec.h>
-#define MAX_FRAMESIZE MPC_DECODER_BUFFER_LENGTH
+// BUFFER_LENGTH is in MPC_SAMPLE_FORMAT units
+#define MAX_FRAMESIZE (4 * MPC_DECODER_BUFFER_LENGTH)
typedef struct context_s {
char *header;
@@ -155,8 +156,8 @@ static int decode_audio(sh_audio_t *sh, unsigned char *buf,
mpc_uint32_t *packet = NULL;
context_t *cd = (context_t *) sh->context;
- if (maxlen < MPC_DECODER_BUFFER_LENGTH) {
- mp_msg(MSGT_DECAUDIO, MSGL_ERR, "maxlen too small in decode_audio\n");
+ if (maxlen < MAX_FRAMESIZE) {
+ mp_msg(MSGT_DECAUDIO, MSGL_V, "maxlen too small in decode_audio\n");
return -1;
}
len = ds_get_packet(sh->ds, (unsigned char **)&packet);