[FFmpeg-devel] [PATCH] avformat/rtmpcrypt: fix discarded const warning

Nicolas George george at nsup.org
Fri Sep 18 21:50:29 CEST 2015

Le jour du Génie, an CCXXIII, Ganesh Ajjanagadde a écrit :
> This patch silences a -Wdiscarded-qualifiers observed with GCC 5.2.
> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
> ---
>  libavformat/rtmpcrypt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

I am not sure this is correct: the buffer is const for a reason, the warning
is right. An application would be completely allowed to give a buffer in
read-only memory, or to reuse the contents of the buffer afterwards.

Actually, I suspect this muxer, if used as first output in the tee muxer,
would cause the next outputs to be corrupt.

The correct fix would probably be to allocate a new buffer, probably keeping
it in the context for performances reasons instead of allocating each time.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150918/7b9d888a/attachment.sig>

More information about the ffmpeg-devel mailing list