Le duodi 2 floréal, an CCXXIII, Michael Niedermayer a écrit :
> This indicates that its safe to use av_free/av_malloc on the IO context
> 
> Signed-off-by: Michael Niedermayer <michae...@gmx.at>
> ---
>  libavformat/avio.h    |    7 +++++++
>  libavformat/aviobuf.c |    1 +
>  libavformat/segment.c |    1 +
>  libavformat/wtvdec.c  |    3 ++-
>  4 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/avio.h b/libavformat/avio.h
> index 51913e3..73d1645 100644
> --- a/libavformat/avio.h
> +++ b/libavformat/avio.h
> @@ -196,6 +196,13 @@ typedef struct AVIOContext {
>       * This field is internal to libavformat and access from outside is not 
> allowed.
>       */
>      int orig_buffer_size;
> +
> +    /**
> +     * The io buffer can be resized or freed with av_free / av_malloc.
> +     * The user application does not keep a private copy of the buffer 
> pointer
> +     * which would become stale on such reallocation.
> +     */
> +    int resizeable;

I suspect you should replace av_malloc() with av_realloc(). For example,
aviobuf.c uses av_realloc(); buffers created with av_malloc() can not
officially be used with av_realloc().

Regards,

-- 
  Nicolas George

Attachment: signature.asc
Description: Digital signature

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to