[FFmpeg-devel] [PATCH] avcodec/snowenc: fix discarded const warning

Ganesh Ajjanagadde gajjanagadde at gmail.com
Sat Sep 19 23:10:58 CEST 2015


This fixes a -Wdiscarded-qualifiers in e.g
http://fate.ffmpeg.org/log.cgi?time=20150919093218&log=compile&slot=x86_64-archlinux-gcc-ddebug.
It is quite clear from the code that the discard of constness was deliberate,
so the cast should be fine.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
---
 libavcodec/snowenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c
index 5e5dc35..86ecc4f 100644
--- a/libavcodec/snowenc.c
+++ b/libavcodec/snowenc.c
@@ -1557,7 +1557,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 {
     SnowContext *s = avctx->priv_data;
     RangeCoder * const c= &s->c;
-    AVFrame *pic = pict;
+    AVFrame *pic = (AVFrame *) pict;
     const int width= s->avctx->width;
     const int height= s->avctx->height;
     int level, orientation, plane_index, i, y, ret;
-- 
2.5.2



More information about the ffmpeg-devel mailing list