[MPlayer-cvslog] CVS: main/libmpcodecs ad_mpc.c,1.6,1.7

Reimar Döffinger CVS syncmail at mplayerhq.hu
Mon Sep 12 23:08:07 CEST 2005


CVS change done by Reimar Döffinger CVS

Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var2/tmp/cvs-serv20321

Modified Files:
	ad_mpc.c 
Log Message:
Fix maximum frame size, could lead to crashes when changing playback speed.


Index: ad_mpc.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ad_mpc.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ad_mpc.c	6 Sep 2005 20:37:47 -0000	1.6
+++ ad_mpc.c	12 Sep 2005 21:08:04 -0000	1.7
@@ -29,7 +29,8 @@
 
 #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 @@
   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);




More information about the MPlayer-cvslog mailing list