[FFmpeg-devel] [PATCH] [RFC] libavcodec/h264_mp4toannexb_bsf.c: Copy const data

Benjamin Larsson banan
Mon Feb 16 16:50:13 CET 2009


Benoit Fouet wrote:
>> ===================================================================
>> --- libavcodec/h264_mp4toannexb_bsf.c	(revision 17373)
>> +++ libavcodec/h264_mp4toannexb_bsf.c	(working copy)
>> @@ -58,7 +58,7 @@
>>  
>>      /* nothing to filter */
>>      if (!avctx->extradata || avctx->extradata_size < 6) {
>> -        *poutbuf = (uint8_t*) buf;
>> +        memcpy(*poutbuf, buf, buf_size);
>>          *poutbuf_size = buf_size;
>>          return 0;
>>      }
>>
>>     
> Index: libavcodec/h264_mp4toannexb_bsf.c
>
> you are missing the fact that output buffer is not allocated at that time.
> BTW, I don't think copying is a good idea, but the fact that output and input data can be the same should be documented, as already told someone else.
>
> Ben
>
>   

Thus violating the const qualifier ?

MvH
Benjamin Larsson






More information about the ffmpeg-devel mailing list