]> git.sesse.net Git - ffmpeg/commitdiff
vf_pad: fix a & instead of && typo
authorXi Wang <xi.wang@gmail.com>
Sun, 10 Mar 2013 03:34:27 +0000 (22:34 -0500)
committerLuca Barbato <lu_zero@gentoo.org>
Sun, 10 Mar 2013 10:16:10 +0000 (11:16 +0100)
Avoid buffer overflow in buffer_needs_copy()

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
libavfilter/vf_pad.c

index 1c969e59a9541b095269f2cd72350afe62efc6b0..4489817367de44a7e10c6255c3e1bcec71cefb4c 100644 (file)
@@ -316,7 +316,7 @@ static int buffer_needs_copy(PadContext *s, AVFrame *frame, AVBufferRef *buf)
             return 1;
 
 #define SIGN(x) ((x) > 0 ? 1 : -1)
-        for (j = 0; j < FF_ARRAY_ELEMS(planes) & planes[j] >= 0; j++) {
+        for (j = 0; j < FF_ARRAY_ELEMS(planes) && planes[j] >= 0; j++) {
             int hsub1 = (planes[j] == 1 || planes[j] == 2) ? s->hsub : 0;
             uint8_t *start1 = frame->data[planes[j]];
             uint8_t *end1   = start1 + (frame->height >> hsub1) *