[libav-bugs] [Bug 712] New: Unchecked conversion from double to enum

bugzilla at libav.org bugzilla at libav.org
Mon Jun 30 13:22:38 CEST 2014


https://bugzilla.libav.org/show_bug.cgi?id=712

           Summary: Unchecked conversion from double to enum
           Product: Libav
           Version: git HEAD
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: Normal
         Component: general
        AssignedTo: bugzilla at libav.org
        ReportedBy: siretart at tauware.de


From: Michael Tautschnig <mt at debian.org>
To: bugs at debian.org
Subject: Unchecked conversion from double to enum
Date: Sat, 24 May 2014 17:07:38 +0100
[Message part 1 (text/plain, inline)]
Package: libav
Version: 6:10.1-1
Usertags: goto-cc

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.

Best,
Michael

-- 
Configure bugmail: https://bugzilla.libav.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


More information about the libav-bugs mailing list