[FFmpeg-devel] [PATCH v2] avcodec/tscc: fix the warning: assigning to 'Bytef *' (aka 'unsigned char *') from 'const uint8_t *

Carl Eugen Hoyos ceffmpeg at gmail.com
Wed Sep 11 02:42:38 EEST 2019


Am Do., 5. Sept. 2019 um 00:45 Uhr schrieb <lance.lmwang at gmail.com>:
>
> From: Limin Wang <lance.lmwang at gmail.com>
>
> Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
> ---
>  libavcodec/tscc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/tscc.c b/libavcodec/tscc.c
> index 6d03081..b0dbef4 100644
> --- a/libavcodec/tscc.c
> +++ b/libavcodec/tscc.c
> @@ -88,7 +88,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
>          av_log(avctx, AV_LOG_ERROR, "Inflate reset error: %d\n", ret);
>          return AVERROR_UNKNOWN;
>      }
> -    c->zstream.next_in   = buf;
> +    c->zstream.next_in   = (uint8_t*)buf;

Iirc, the warning also happens when compiling for android and the reason
is that their zlib header is different / old and therefore doesn't mark the
input as const (as the zlib header does on different systems here, both
new and old). I therefore believe this line should not be changed.

If it is changed, the commit message should first state was is done
("cast a pointer to avoid a warning") and the actual complete warning
should be part of the commit message.

Carl Eugen

(Checking Android sources seems to show that they have fixed
this issue in more recent versions.)


More information about the ffmpeg-devel mailing list