avfilter/vf_cover_rect: Handle the case where the cover rectangle is as large as...
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 12 May 2015 18:19:47 +0000 (20:19 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 12 May 2015 18:19:47 +0000 (20:19 +0200)
Fixes division by 0
Fixes CID1297575

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavfilter/vf_cover_rect.c

index d12807a..c2020bb 100644 (file)
@@ -132,7 +132,7 @@ static void blur(CoverContext *cover, AVFrame *in, int offx, int offy)
                     s += data[x + h*stride] * scale;
                     c += scale;
                 }
-                data[x + y*stride] = (s + (c>>1)) / c;
+                data[x + y*stride] = c ? (s + (c>>1)) / c : 0;
             }
         }
     }