On Fri, Jul 25, 2014 at 07:01:15AM +0200, Kostya Shishkov wrote:
> On Thu, Jul 24, 2014 at 05:03:28PM -0700, Diego Biurrun wrote:
> > libavcodec/lcldec.c:165:30: warning: cast discards ‘__attribute__((const))’
> > qualifier from pointer target type
> > ---
> > --- a/libavcodec/lcldec.c
> > +++ b/libavcodec/lcldec.c
> > @@ -159,10 +159,9 @@ static int zlib_decomp(AVCodecContext *avctx, const
> > uint8_t *src, int src_len, i
> > static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
> > AVPacket *avpkt)
> > {
> > AVFrame *frame = data;
> > - const uint8_t *buf = avpkt->data;
> > int buf_size = avpkt->size;
> > LclDecContext * const c = avctx->priv_data;
> > - unsigned char *encoded = (unsigned char *)buf;
> > + unsigned char *encoded = avpkt->data;
> > unsigned int pixel_ptr;
> > int row, col;
> > unsigned char *outptr;
>
> Here it's even funnier because the same variable is reused in two cases
> (otherwise it could've been made const too).
I don't see the problem here; encoded is written to, but the packet contents
is copied before. So it cannot be const, but writing to the memory location
is safe...
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel