[MPlayer-advusers] [BUG] [PPC] AC3 crash in uninit_acodec
Diego Biurrun
diego at biurrun.de
Mon Feb 13 00:26:12 CET 2006
On Fri, Jan 27, 2006 at 02:28:31AM +0100, Diego Biurrun wrote:
> On Fri, Jan 27, 2006 at 01:14:10AM +0100, Diego Biurrun wrote:
> > On Mon, Jan 23, 2006 at 01:57:12PM +0100, Diego Biurrun wrote:
> > >
> > > there is a quite serious bug when using AC3 on AltiVec systems. Any AC3
> > > audio file (and DVDs) crashes MPlayer at end of file or when exiting
> > > manually with messages like
> > >
> > > *** glibc detected *** free(): invalid pointer: 0x1076f3f8 ***
> >
> > Some more info: This happens with a current Debian unstable system on a
> > February 2005 PowerBook with a 1500MHz G4. I tested with gcc 4.0.3,
> > 3.4.6 and 3.3.6 - all from Debian - no difference.
>
> Using the updated liba52 that was posted to dev-eng does not make a
> difference. Also, for some reason Luca Barbato cannot reproduce this
> problem on Gentoo...
However, he can come up with a patch that fixes the problem...
It works for me, but I'd appreciate if somebody could look this over
before I commit...
Diego
-------------- next part --------------
--- libmpcodecs/dec_audio.c 9 Feb 2006 14:07:55 -0000 1.48
+++ libmpcodecs/dec_audio.c 12 Feb 2006 23:19:08 -0000
@@ -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;
@@ -251,7 +251,8 @@
if(sh_audio->afilter){
mp_msg(MSGT_DECAUDIO,MSGL_V,"Uninit audio filters...\n");
af_uninit(sh_audio->afilter);
- free(sh_audio->afilter);
+ mp_msg(MSGT_DECAUDIO,MSGL_V,"Uninit audio filters... done\n");
+ //free(sh_audio->afilter);
sh_audio->afilter=NULL;
}
if(sh_audio->inited){
@@ -327,7 +328,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-advusers
mailing list