[FFmpeg-cvslog] r8900 - trunk/libavcodec/mpegaudio_parser.c

Måns Rullgård mans
Sun May 6 00:54:22 CEST 2007


aurel <subversion at mplayerhq.hu> writes:

> Author: aurel
> Date: Sat May  5 20:17:03 2007
> New Revision: 8900
>
> Log:
> avoid a 'discards qualifiers from pointe' warning
>
> Modified:
>    trunk/libavcodec/mpegaudio_parser.c
>
> Modified: trunk/libavcodec/mpegaudio_parser.c
> ==============================================================================
> --- trunk/libavcodec/mpegaudio_parser.c	(original)
> +++ trunk/libavcodec/mpegaudio_parser.c	Sat May  5 20:17:03 2007
> @@ -186,7 +186,7 @@ static int mpegaudio_parse(AVCodecParser
>          if(s->frame_size > 0 && buf_ptr - buf == s->inbuf_ptr - s->inbuf
>             && buf_size + buf_ptr - buf >= s->frame_size){
>              if(s->header_count > 0){
> -                *poutbuf = buf;
> +                *poutbuf = (uint8_t *)buf;

This is wrong.  Never, *ever* remove a const qualifier.  The data
pointed to might actually be read-only.  The correct solution is to
make the assigned to variable also a pointer to const.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-cvslog mailing list