[FFmpeg-devel] [PATCH 2/2] dnn_backend_native: check operand index
Guo, Yejun
yejun.guo at intel.com
Tue Jun 16 11:18:11 EEST 2020
> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of
> mypopy at gmail.com
> Sent: 2020年6月16日 14:18
> To: FFmpeg development discussions and patches <ffmpeg-devel at ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH 2/2] dnn_backend_native: check operand
> index
>
> On Wed, Jun 10, 2020 at 10:04 PM Guo Yejun <yejun.guo at intel.com> wrote:
> >
> > it fixed the issue in https://trac.ffmpeg.org/ticket/8716
> >
> > Signed-off-by: Guo Yejun <yejun.guo at intel.com>
> >
> > + if (operand_index >= network->operands_num) {
> > + goto fail;
> > + }
> > +
> I prefer
> if (expr)
> statements();
> without the braces if only a single statement.
thanks for the review.
I personally like to always add '{}' to avoid possible mistakes when we change code in the future. Some coding styles also recommend this method.
I checked at http://ffmpeg.org/developer.html#Coding-Rules and do not find an explicit description. But I just remembered that someone also mentioned this some time ago. I'll change to this style in v2 if no support from others for my style.
More information about the ffmpeg-devel
mailing list