[FFmpeg-cvslog] lavc/libutvideoenc: Cast an unsigned constant to int.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Thu May 12 23:19:49 CEST 2016



On 12.05.2016, at 09:08, git at videolan.org (Carl Eugen Hoyos) wrote:

> ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Thu May 12 09:07:02 2016 +0200| [d1cacbbea946f39fb7a7ff9852bc5d8c1e67143c] | committer: Carl Eugen Hoyos
> 
> lavc/libutvideoenc: Cast an unsigned constant to int.
> 
> Fixes the following warning / error:
> libavcodec/libutvideoenc.cpp:281:1: warning: narrowing conversion of ‘3221258240u’ from ‘unsigned int’ to ‘int’ inside { } is ill-formed in C++11 [-Wnarrowing]
> 
> Fixes ticket #5542.
> 
>> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d1cacbbea946f39fb7a7ff9852bc5d8c1e67143c
> ---
> 
> libavcodec/libutvideoenc.cpp |    2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/libutvideoenc.cpp b/libavcodec/libutvideoenc.cpp
> index d5dfef9..d03d515 100644
> --- a/libavcodec/libutvideoenc.cpp
> +++ b/libavcodec/libutvideoenc.cpp
> @@ -254,7 +254,7 @@ AVCodec ff_libutvideo_encoder = {
>     NULL_IF_CONFIG_SMALL("Ut Video"),
>     AVMEDIA_TYPE_VIDEO,
>     AV_CODEC_ID_UTVIDEO,
> -    AV_CODEC_CAP_AUTO_THREADS | AV_CODEC_CAP_LOSSLESS | AV_CODEC_CAP_INTRA_ONLY,
> +    AV_CODEC_CAP_AUTO_THREADS | (int)AV_CODEC_CAP_LOSSLESS | AV_CODEC_CAP_INTRA_ONLY,

That doesn't seem like a good idea, AV_CODEC_CAP_LOSSLESS does not fit in int, so we should not try to store it in one, not explicitly cast to int...


More information about the ffmpeg-cvslog mailing list