diff mbox series

[FFmpeg-devel,2/2] avfilter/vf_find_rect: Remove assert

Message ID 20200126194507.10964-2-michael@niedermayer.cc
State Accepted
Headers show
Series [FFmpeg-devel,1/2] avfilter/vf_find_rect: Increase worst score | expand

Checks

Context Check Description
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Michael Niedermayer Jan. 26, 2020, 7:45 p.m. UTC
A score of 0 is possible
Fixes: Ticket8500

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavfilter/vf_find_rect.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Paul B Mahol Jan. 26, 2020, 8:12 p.m. UTC | #1
lgtm

On 1/26/20, Michael Niedermayer <michael@niedermayer.cc> wrote:
> A score of 0 is possible
> Fixes: Ticket8500
>
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavfilter/vf_find_rect.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/libavfilter/vf_find_rect.c b/libavfilter/vf_find_rect.c
> index 458252a7ba..dbe6a07c28 100644
> --- a/libavfilter/vf_find_rect.c
> +++ b/libavfilter/vf_find_rect.c
> @@ -169,7 +169,6 @@ static float search(FOCContext *foc, int pass, int
> maxpass, int xmin, int xmax,
>      for (y = ymin; y <= ymax; y++) {
>          for (x = xmin; x <= xmax; x++) {
>              float score = compare(foc->haystack_frame[pass],
> foc->needle_frame[pass], x, y);
> -            av_assert0(score != 0);
>              if (score < best_score) {
>                  best_score = score;
>                  *best_x = x;
> --
> 2.25.0
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Andreas Rheinhardt Jan. 26, 2020, 11:38 p.m. UTC | #2
On Sun, Jan 26, 2020 at 8:49 PM Michael Niedermayer <michael@niedermayer.cc>
wrote:

> A score of 0 is possible
> Fixes: Ticket8500
>
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavfilter/vf_find_rect.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/libavfilter/vf_find_rect.c b/libavfilter/vf_find_rect.c
> index 458252a7ba..dbe6a07c28 100644
> --- a/libavfilter/vf_find_rect.c
> +++ b/libavfilter/vf_find_rect.c
> @@ -169,7 +169,6 @@ static float search(FOCContext *foc, int pass, int
> maxpass, int xmin, int xmax,
>      for (y = ymin; y <= ymax; y++) {
>          for (x = xmin; x <= xmax; x++) {
>              float score = compare(foc->haystack_frame[pass],
> foc->needle_frame[pass], x, y);
> -            av_assert0(score != 0);
>              if (score < best_score) {
>                  best_score = score;
>                  *best_x = x;
>
> This seems to be the only assert in that file, so you should also stop
including the avassert.h header.

- Andreas
Michael Niedermayer Jan. 27, 2020, 10:41 a.m. UTC | #3
On Mon, Jan 27, 2020 at 12:38:45AM +0100, Andreas Rheinhardt wrote:
> On Sun, Jan 26, 2020 at 8:49 PM Michael Niedermayer <michael@niedermayer.cc>
> wrote:
> 
> > A score of 0 is possible
> > Fixes: Ticket8500
> >
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavfilter/vf_find_rect.c | 1 -
> >  1 file changed, 1 deletion(-)
> >
> > diff --git a/libavfilter/vf_find_rect.c b/libavfilter/vf_find_rect.c
> > index 458252a7ba..dbe6a07c28 100644
> > --- a/libavfilter/vf_find_rect.c
> > +++ b/libavfilter/vf_find_rect.c
> > @@ -169,7 +169,6 @@ static float search(FOCContext *foc, int pass, int
> > maxpass, int xmin, int xmax,
> >      for (y = ymin; y <= ymax; y++) {
> >          for (x = xmin; x <= xmax; x++) {
> >              float score = compare(foc->haystack_frame[pass],
> > foc->needle_frame[pass], x, y);
> > -            av_assert0(score != 0);
> >              if (score < best_score) {
> >                  best_score = score;
> >                  *best_x = x;
> >
> > This seems to be the only assert in that file, so you should also stop
> including the avassert.h header.

will apply with that change

thx

[...]
diff mbox series

Patch

diff --git a/libavfilter/vf_find_rect.c b/libavfilter/vf_find_rect.c
index 458252a7ba..dbe6a07c28 100644
--- a/libavfilter/vf_find_rect.c
+++ b/libavfilter/vf_find_rect.c
@@ -169,7 +169,6 @@  static float search(FOCContext *foc, int pass, int maxpass, int xmin, int xmax,
     for (y = ymin; y <= ymax; y++) {
         for (x = xmin; x <= xmax; x++) {
             float score = compare(foc->haystack_frame[pass], foc->needle_frame[pass], x, y);
-            av_assert0(score != 0);
             if (score < best_score) {
                 best_score = score;
                 *best_x = x;