[FFmpeg-devel] [PATCH] lavc/ccaption_dec: fix always true condition

Clément Bœsch u at pkh.me
Thu Jan 7 22:45:48 CET 2016


On Wed, Jan 06, 2016 at 01:39:30AM +0100, Michael Niedermayer wrote:
> On Tue, Jan 05, 2016 at 09:54:54PM +0100, Clément Bœsch wrote:
> > No idea why this wasn't ever detected by a static analyzer.
> > ---
> >  libavcodec/ccaption_dec.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c
> > index 4e478e0..94771d5 100644
> > --- a/libavcodec/ccaption_dec.c
> > +++ b/libavcodec/ccaption_dec.c
> > @@ -462,7 +462,7 @@ static int process_cc608(CCaptionSubContext *ctx, int64_t pts, uint8_t hi, uint8
> >  #define COR3(var, with1, with2, with3)  ( (var) == (with1) ||  (var) == (with2) || (var) == (with3) )
> >      if ( hi == ctx->prev_cmd[0] && lo == ctx->prev_cmd[1]) {
> >      /* ignore redundant command */
> > -    } else if ( (hi == 0x10 && (lo >= 0x40 || lo <= 0x5f)) ||
> > +    } else if ( (hi == 0x10 && (lo >= 0x40 && lo <= 0x5f)) ||
> 
> without checking any specs, the code looks better after the patch
> than before
> 

thx, applied

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160107/cf5e6562/attachment.sig>


More information about the ffmpeg-devel mailing list