On 2017-08-22 17:23 +0000, Michael Niedermayer wrote:
> ffmpeg | branch: master | Michael Niedermayer <mich...@niedermayer.cc> | Tue 
> Aug 22 18:36:26 2017 +0200| [a2e444d5bb2e3115d3afcc0cca9d1506c90436a2] | 
> committer: Michael Niedermayer
> 
> avcodec/pngdec: Fix () placement
> 
> Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>
> 
> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a2e444d5bb2e3115d3afcc0cca9d1506c90436a2
> ---
> 
>  libavcodec/pngdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
> index 4fc1c5a062..dce8faf168 100644
> --- a/libavcodec/pngdec.c
> +++ b/libavcodec/pngdec.c
> @@ -858,7 +858,7 @@ static int decode_iccp_chunk(PNGDecContext *s, int 
> length, AVFrame *f)
>  
>      length = FFMAX(length - 1, 0);
>  
> -    if ((ret = decode_zbuf(&bp, s->gb.buffer, s->gb.buffer + length) < 0))
> +    if ((ret = decode_zbuf(&bp, s->gb.buffer, s->gb.buffer + length)) < 0)

IMHO another reason not to do the assignment and the comparison on the same
line inside the if-condition in C.

I mean you need the extra parens and if you are not careful enough you will 
just get it silently wrong like it was above.

Probably we found enough of such errors to discourage that style in FFmpeg?


>          return ret;
>  
>      av_bprint_finalize(&bp, (char **)&data);


  Alexander
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to