diff mbox

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

Message ID 20190910141906.31117-1-lance.lmwang@gmail.com
State New
Headers show

Commit Message

Lance Wang Sept. 10, 2019, 2:19 p.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavcodec/pngenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Carl Eugen Hoyos Sept. 11, 2019, 8:53 p.m. UTC | #1
Am Di., 10. Sept. 2019 um 16:19 Uhr schrieb <lance.lmwang@gmail.com>:
>
> From: Limin Wang <lance.lmwang@gmail.com>
>
> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> ---
>  libavcodec/pngenc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
> index d4d8dc8..e78a829 100644
> --- a/libavcodec/pngenc.c
> +++ b/libavcodec/pngenc.c
> @@ -274,7 +274,7 @@ static int png_write_row(AVCodecContext *avctx, const uint8_t *data, int size)
>      int ret;
>
>      s->zstream.avail_in = size;
> -    s->zstream.next_in  = data;
> +    s->zstream.next_in  = (uint8_t*)data;

Same comment:
I am not convinced that this is a good change as FFmpeg requests const
next_in from libz via a compile option but in any case, the commit
message should contain the actual, complete warning.

Carl Eugen
diff mbox

Patch

diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index d4d8dc8..e78a829 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -274,7 +274,7 @@  static int png_write_row(AVCodecContext *avctx, const uint8_t *data, int size)
     int ret;
 
     s->zstream.avail_in = size;
-    s->zstream.next_in  = data;
+    s->zstream.next_in  = (uint8_t*)data;
     while (s->zstream.avail_in > 0) {
         ret = deflate(&s->zstream, Z_NO_FLUSH);
         if (ret != Z_OK)