[FFmpeg-trac] #6752(avformat:closed): ffmpeg-3.4/libavformat/hlsenc.c:210: bad if statement ?

FFmpeg trac at avcodec.org
Tue Nov 27 18:40:25 EET 2018


#6752: ffmpeg-3.4/libavformat/hlsenc.c:210: bad if statement ?
------------------------------------+------------------------------------
             Reporter:  dcb         |                    Owner:
                 Type:  defect      |                   Status:  closed
             Priority:  normal      |                Component:  avformat
              Version:  git-master  |               Resolution:  fixed
             Keywords:  hls         |               Blocked By:
             Blocking:              |  Reproduced by developer:  0
Analyzed by developer:  0           |
------------------------------------+------------------------------------
Description changed by cehoyos:

Old description:

> ffmpeg-3.4/libavformat/hlsenc.c:210]: (warning) Logical disjunction
> always evaluates to true: EXPR != '/' || EXPR != '\\'.
>
> Source code is
> {{{
>     if ((*(pos - 1) != '/') || (*(pos - 1) != '\\')) {
> }}}
> Maybe better code
> {{{
>     if ((*(pos - 1) != '/') && (*(pos - 1) != '\\')) {
> }}}

New description:

 ffmpeg-3.4/libavformat/hlsenc.c:210]: (warning) Logical disjunction always
 evaluates to true: `EXPR != '/' || EXPR != '\\'`.

 Source code is
 {{{
     if ((*(pos - 1) != '/') || (*(pos - 1) != '\\')) {
 }}}
 Maybe better code
 {{{
     if ((*(pos - 1) != '/') && (*(pos - 1) != '\\')) {
 }}}

--

--
Ticket URL: <https://trac.ffmpeg.org/ticket/6752#comment:2>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list