[MPlayer-cvslog] CVS: main/libmpcodecs dec_audio.c,1.48,1.49

Diego Biurrun CVS syncmail at mplayerhq.hu
Tue Feb 14 10:55:17 CET 2006


CVS change done by Diego Biurrun CVS

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

Modified Files:
	dec_audio.c 
Log Message:
Align memory at 16 byte boundaries.
This fixes crashes related to AltiVec as reported at
http://mplayerhq.hu/pipermail/mplayer-advusers/2006-January/001381.html
patch by Luca Barbato, lu_zero #at# gentoo #dot# org


Index: dec_audio.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/dec_audio.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- dec_audio.c	9 Feb 2006 14:07:55 -0000	1.48
+++ dec_audio.c	14 Feb 2006 09:55:14 -0000	1.49
@@ -68,7 +68,7 @@
       sh_audio->a_in_buffer_size=sh_audio->audio_in_minsize;
       mp_msg(MSGT_DECAUDIO,MSGL_V,MSGTR_AllocatingBytesForInputBuffer,
           sh_audio->a_in_buffer_size);
-      sh_audio->a_in_buffer=malloc(sh_audio->a_in_buffer_size);
+      sh_audio->a_in_buffer=memalign(16,sh_audio->a_in_buffer_size);
       memset(sh_audio->a_in_buffer,0,sh_audio->a_in_buffer_size);
       sh_audio->a_in_buffer_len=0;
   }
@@ -79,7 +79,7 @@
   mp_msg(MSGT_DECAUDIO,MSGL_V,MSGTR_AllocatingBytesForOutputBuffer,
       sh_audio->audio_out_minsize,MAX_OUTBURST,sh_audio->a_buffer_size);
 
-  sh_audio->a_buffer=malloc(sh_audio->a_buffer_size);
+  sh_audio->a_buffer=memalign(16,sh_audio->a_buffer_size);
   if(!sh_audio->a_buffer){
       mp_msg(MSGT_DECAUDIO,MSGL_ERR,MSGTR_CantAllocAudioBuf);
       return 0;
@@ -327,7 +327,7 @@
   if(out_maxsize<8192) out_maxsize=MAX_OUTBURST; // not sure this is ok
 
   sh_audio->a_out_buffer_size=out_maxsize;
-  sh_audio->a_out_buffer=malloc(sh_audio->a_out_buffer_size);
+  sh_audio->a_out_buffer=memalign(16,sh_audio->a_out_buffer_size);
   memset(sh_audio->a_out_buffer,0,sh_audio->a_out_buffer_size);
   sh_audio->a_out_buffer_len=0;
   }




More information about the MPlayer-cvslog mailing list