On Sun, Jul 20, 2014 at 02:53:44PM -0400, Reinhard Tartler wrote:
>
> ---------- Forwarded message ----------
> From: Michael Tautschnig <[email protected]>
> Date: Sat, May 24, 2014 at 12:07 PM
> Subject: Bug#749164: Unchecked conversion from double to enum
> To: [email protected]
>
> During a rebuild of all packages in a clean sid chroot (and
> cowbuilder+pbuilder)
> the build failed with the following error. Please note that we use our
> research
> compiler tool-chain (using tools from the cbmc package), which permits
> extended
> reporting on type inconsistencies at link time.
>
> [...]
> gcc -I. -I/srv/jenkins-slave/workspace/sid-goto-cc-libav/libav-10.1
> -D_FORTIFY_SOURCE=2 -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64
> -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
> -DHAVE_AV_CONFIG_H -fstack-protector --param=ssp-buffer-size=4
> -Wformat -Werror=format-security -std=c99 -fomit-frame-pointer
> -pthread -I/usr/include/p11-kit-1 -I/usr/include/freetype2
> -I/usr/include/opencv -I/usr/include/opus -D_REENTRANT
> -I/usr/include/p11-kit-1 -I/usr/include/schroedinger-1.0
> -I/usr/include/orc-0.4 -g -Wdeclaration-after-statement -Wall
> -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wcast-qual
> -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes
> -Wstrict-prototypes -Wno-parentheses -Wno-switch
> -Wno-format-zero-length -Wno-pointer-sign -O3 -fno-math-errno
> -fno-signed-zeros -fno-tree-vectorize
> -Werror=implicit-function-declaration -Werror=missing-prototypes
> -Werror=return-type -Werror=declaration-after-statement -Werror=vla
> -Wno-maybe-uninitialized -MMD -MF libavfilter/vf_select.d -MT
> libavfilter/vf_select.o -c -o libavfilter/vf_select.o
> /srv/jenkins-slave/workspace/sid-goto-cc-libav/libav-10.1/libavfilter/vf_select.c
> file
> /srv/jenkins-slave/workspace/sid-goto-cc-libav/libav-10.1/libavfilter/vf_select.c
> line 218 function select_frame: in expression
> `select->var_values[(signed long int)12]':
> conversion from `double' to `int': implicit conversion not permitted
> CONVERSION ERROR
> make[1]: *** [libavfilter/vf_select.o] Error 64
> make[1]: *** Waiting for unfinished jobs....
>
> Given that av_get_picture_type_char requires an enum argument:
>
> http://sources.debian.net/src/libav/6:10.1-1/libavutil/avutil.h?hl=269#L269
>
> ideally an explicit conversion with suitable checks on values should be
> performed here:
>
> http://sources.debian.net/src/libav/6:10.1-1/libavfilter/vf_select.c?hl=218#L218
>
> But looking a few lines above at least an explicit (int) type cast would be in
> line with the remainder of the code.
The offending bit is the following:
av_log(inlink->dst, AV_LOG_DEBUG,
"n:%d pts:%d t:%f interlace_type:%c key:%d pict_type:%c "
"-> select:%f\n",
(int)select->var_values[VAR_N],
(int)select->var_values[VAR_PTS],
select->var_values[VAR_T],
select->var_values[VAR_INTERLACE_TYPE] == INTERLACE_TYPE_P ? 'P' :
select->var_values[VAR_INTERLACE_TYPE] == INTERLACE_TYPE_T ? 'T' :
select->var_values[VAR_INTERLACE_TYPE] == INTERLACE_TYPE_B ? 'B' :
'?',
(int)select->var_values[VAR_KEY],
av_get_picture_type_char(select->var_values[VAR_PICT_TYPE]),
res);
where the signature of the offending function is
libavutil/avutil.h:char av_get_picture_type_char(enum AVPictureType
pict_type);
and the relevant part of the struct
typedef struct SelectContext {
double var_values[VAR_VARS_NB];
} SelectContext;
One could just cast the function argument or drop the debug av_log.
I'd go for the latter.
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel