[FFmpeg-devel] [PATCH] libavcodec/zmbv.c: Don't modify const buffer

Patrik Kullman patrik
Tue Feb 17 14:12:51 CET 2009

On Tue, 2009-02-17 at 14:09 +0100, Benoit Fouet wrote:
> Hi,
> On 02/17/2009 01:56 PM, Patrik Kullman wrote:
> > Trying to solve this issue somewhere else than BSFs until that API is
> > sorted out.
> >
> > Copy the const input buffer into the Zlib struct instead of using the
> > same address.
> >
> > Prevents warning:
> > libavcodec/zmbv.c: In function ?decode_frame?:
> > libavcodec/zmbv.c:494: warning: assignment discards qualifiers from
> > pointer target type
> >
> > After inflate() is complated, free next_in.
> >   
> well, IMHO, the zlib z_stream structure is lacking a const qualifier, we
> shouldn't copy the input stream just to work that around.

Well, from the zlib.h:

  The detailed semantics are as follows. inflate performs one or both of the
  following actions:

  - Decompress more input starting at next_in and update next_in and avail_in
    accordingly. If not all input can be processed (because there is not
    enough room in the output buffer), next_in is updated and processing
    will resume at this point for the next call of inflate().

If next_in is updated I guess it shouldn't be a const?

More information about the ffmpeg-devel mailing list