[libav-bugs] [Bug 283] avplay.c some code will never be executed.

bugzilla at libav.org bugzilla at libav.org
Tue May 2 01:54:52 CEST 2017


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

Sean McGovern <gseanmcg at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|NEW                         |RESOLVED

--- Comment #1 from Sean McGovern <gseanmcg at gmail.com> ---
(In reply to Rayh from comment #0)
> In avplay.c/fplay.c
> 
> else if (wanted_size > samples_size) {
>        uint8_t *samples_end, *q;
>        int nb;
> 
>           /* add samples */
>           nb = (samples_size - wanted_size);
>         ...
>           while (nb > 0) {
>             memcpy(q, samples_end, n);
>             q += n;
>             nb -= n;
>          }
> ...
> }
> 
> because wanted_size > samples_size and  nb = (samples_size - wanted_size),
> 
> so nb < 0,the code in the loop of while will never be touched.

nb is decremented inside the loop.

-- 
You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libav.org/pipermail/libav-bugs/attachments/20170501/e4a3ba1e/attachment.html>


More information about the libav-bugs mailing list