[Ffmpeg-devel] [PATCH] fix for segfault in mac3 audio

Diego Biurrun diego
Thu Aug 24 22:44:45 CEST 2006


CCing Laszlo Torok, the original author, and Alan Curry, the patch
author.

On Tue, Aug 22, 2006 at 09:13:09PM -0400, compn wrote:
> i get a segfault on win32 playing mac3audio.mov in mphq/incoming
> 
> tcsattr made this patch, which fixes the problem.
> 
> he said that the buffers were incorrect. it maybe wise to check
> the buffers of other old libavcodecs to make sure they are correct
> as well...
> 
> attached is the patch.
> 
> --- libavcodec/mace.c	(revision 6005)
> +++ libavcodec/mace.c	(working copy)
> @@ -410,18 +410,18 @@
>  #ifdef DEBUG
>  puts("mace_decode_frame[3]()");
>  #endif
> -        Exp1to3(c, buf, samples, buf_size / 2, avctx->channels, 1);
> +        Exp1to3(c, buf, samples, buf_size / 2 / avctx->channels, avctx->channels, 1);
>          if (avctx->channels == 2)
> -            Exp1to3(c, buf, samples+1, buf_size / 2, 2, 2);
> +            Exp1to3(c, buf, samples+1, buf_size / 2 / 2, 2, 2);
>          *data_size = 2 * 3 * buf_size;
>          break;
>      case CODEC_ID_MACE6:
>  #ifdef DEBUG
>  puts("mace_decode_frame[6]()");
>  #endif
> -        Exp1to6(c, buf, samples, buf_size, avctx->channels, 1);
> +        Exp1to6(c, buf, samples, buf_size / avctx->channels, avctx->channels, 1);
>          if (avctx->channels == 2)
> -            Exp1to6(c, buf, samples+1, buf_size, 2, 2);
> +            Exp1to6(c, buf, samples+1, buf_size / 2, 2, 2);
>          *data_size = 2 * 6 * buf_size;
>          break;
>      default:

mac3/mac6 samples can be found at

http://samples.mplayerhq.hu/A-codecs/MACE/

Now can somebody tell me if the patch is fit to apply or not?  Laszlo,
maybe you can comment on it...

Diego




More information about the ffmpeg-devel mailing list