[x265] A few warnings from GCC 4.8.2

Steve Borho steve at borho.org
Mon Jul 14 18:10:27 CEST 2014


On 07/13, Mario Rohkr?mer wrote:
> level.cpp
> +----
> h:/MSYS/home/LigH/x265/source/encoder/level.cpp: In function 'void
> x265::determineLevel(const x265_param&, x265::Profile::Name&,
> x265::Level::Name&, x265::Level::Tier&)':
> h:/MSYS/home/LigH/x265/source/encoder/level.cpp:143:24: warning: array
> subscript is above array bounds [-Warray-bounds]
>          while (levels[i].levelIdc < param.levelIdc && levels[i].levelIdc)
>                         ^
> h:/MSYS/home/LigH/x265/source/encoder/level.cpp:143:24: warning: array
> subscript is above array bounds [-Warray-bounds]
> +----

My version of gcc doesn't complain about this one. The loop is safe, the
levels[i].levelIdc check prevents it from going off the end. Oh well, I
guess I can turn it into a sizeof() check

> ratecontrol.cpp
> +----
> h:/MSYS/home/LigH/x265/source/encoder/ratecontrol.cpp: In member function
> 'bool x265::RateControl::initPass2()':
> h:/MSYS/home/LigH/x265/source/encoder/ratecontrol.cpp:731:6: warning:
> 'minVal' may be used uninitialized in this function [-Wmaybe-uninitialized]
>  bool RateControl::initPass2()
>       ^
> h:/MSYS/home/LigH/x265/source/encoder/ratecontrol.cpp:731:6: warning:
> 'maxVal' may be used uninitialized in this function [-Wmaybe-uninitialized]
> h:/MSYS/home/LigH/x265/source/encoder/ratecontrol.cpp:731:6: warning: 'a'
> may be used uninitialized in this function [-Wmaybe-uninitialized]
> h:/MSYS/home/LigH/x265/source/encoder/ratecontrol.cpp:731:6: warning:
> 'minVal' may be used uninitialized in this function [-Wmaybe-uninitialized]
> h:/MSYS/home/LigH/x265/source/encoder/ratecontrol.cpp:731:6: warning:
> 'maxVal' may be used uninitialized in this function [-Wmaybe-uninitialized]
> h:/MSYS/home/LigH/x265/source/encoder/ratecontrol.cpp:731:6: warning: 'a'
> may be used uninitialized in this function [-Wmaybe-uninitialized]
> +----

these I were are of; interestingly the function has none of these
variables. I haven't figured out where they come from yet, but I think
it's somehow related to Clip3

-- 
Steve Borho


More information about the x265-devel mailing list