# HG changeset patch # User reimar # Date 1126559284 0 # Node ID 0c22fbbbc2c73e198fa936e3af49a1787ceab0e1 # Parent b866f6be154a567bee06c5f80619576ee75518ee Fix maximum frame size, could lead to crashes when changing playback speed. diff -r b866f6be154a -r 0c22fbbbc2c7 libmpcodecs/ad_mpc.c --- a/libmpcodecs/ad_mpc.c Mon Sep 12 20:37:53 2005 +0000 +++ b/libmpcodecs/ad_mpc.c Mon Sep 12 21:08:04 2005 +0000 @@ -29,7 +29,8 @@ #include -#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 @@ 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);