[FFmpeg-cvslog] vf_pad: fix a & instead of && typo

Xi Wang git at videolan.org
Wed Mar 13 01:55:10 CET 2013


ffmpeg | branch: master | Xi Wang <xi.wang at gmail.com> | Sat Mar  9 22:34:27 2013 -0500| [5d639b2b4a6d1f5710cfe247dea4d4c6debdfe0d] | committer: Luca Barbato

vf_pad: fix a & instead of && typo

Avoid buffer overflow in buffer_needs_copy()

Signed-off-by: Xi Wang <xi.wang at gmail.com>
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5d639b2b4a6d1f5710cfe247dea4d4c6debdfe0d
---

 libavfilter/vf_pad.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_pad.c b/libavfilter/vf_pad.c
index 1c969e5..4489817 100644
--- a/libavfilter/vf_pad.c
+++ b/libavfilter/vf_pad.c
@@ -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) *



More information about the ffmpeg-cvslog mailing list