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

Michael Niedermayer michael at niedermayer.cc
Wed Jan 6 01:39:30 CET 2016


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

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

What does censorship reveal? It reveals fear. -- Julian Assange
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160106/2abda2b5/attachment.sig>


More information about the ffmpeg-devel mailing list