ultravideo / uvgRTP

An open-source library for RTP/SRTP media delivery
BSD 2-Clause "Simplified" License
296 stars 84 forks source link

uint8 overflow in a test #203

Closed witaly-iwanow closed 5 months ago

witaly-iwanow commented 8 months ago

This looks like a bug/oversight as obviously 256 won't fit into an unsigned char:

[ 96%] Building CXX object test/CMakeFiles/uvgrtp_test.dir/test_5_srtp_zrtp.cpp.o
/home/vitaly/uvgRTP/test/test_5_srtp_zrtp.cpp:94:23: warning: result of comparison of constant 256 with expression of type 'uint8_t' (aka 'unsigned char') is always false [-Wtautological-constant-out-of-range-compare]
    else if (key_size == 256)
             ~~~~~~~~ ^  ~~~
/home/vitaly/uvgRTP/test/test_5_srtp_zrtp.cpp:136:23: warning: result of comparison of constant 256 with expression of type 'uint8_t' (aka 'unsigned char') is always false [-Wtautological-constant-out-of-range-compare]
    else if (key_size == 256)
             ~~~~~~~~ ^  ~~~
jrsnen commented 8 months ago

Hi.

Nice catch, thanks! We'll see when me or @tampsa has time to fix this, PRs are also welcome.

BR, Joni Räsänen

tampsa commented 5 months ago

Hi,

Issue is fixed and will be pushed to Github shortly.