[opus] A potential error in opus-1.1.3

Zhendong Wu clarkwzd at 163.com
Mon Dec 5 13:14:26 UTC 2016


Hi, 


I downloaded the source code of opus-1.1.3.tar.gz, and statically analyzed the code by a static analysis tool. Many potential false alarms are reported. I checked manually and selected a potential error which is described as follow. Could you please check it?


In file ‘src/opus_encoder.c’, function ‘opus_encode_native’, the piece of code is:


…
Line 1802: if (frame_size == 2*st->Fs/25)  /* 80 ms -> 2x 40 ms */
Line 1803:   enc_frame_size = st->Fs/25;
Line 1804: if (frame_size == 3*st->Fs/25)  /* 120 ms -> 2x 60 ms */
Line 1805:   enc_frame_size = 3*st->Fs/50;
Line 1806: else                            /* 100 ms -> 5x 20 ms */
Line 1807:   enc_frame_size = st->Fs/50; 
…


In the above code, Line 1802 and 1803 may be not useful. Because the result of variable ‘enc_frame_size’ is not read and used. After executing Line 1805 or Line 1807, the value of ‘enc_frame_size’ is overwritten. 


Looking forward to your reply.


Best,
Zhendong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xiph.org/pipermail/opus/attachments/20161205/6e3b0bc6/attachment.html>


More information about the opus mailing list