[FFmpeg-cvslog] lavfi/lut3d: avoid overread.

Clément Bœsch git at videolan.org
Wed May 22 22:13:05 CEST 2013


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Wed May 22 22:12:14 2013 +0200| [91b461459a5dea7e032d6a16ad18c6b9dc188a2e] | committer: Clément Bœsch

lavfi/lut3d: avoid overread.

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

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

diff --git a/libavfilter/vf_lut3d.c b/libavfilter/vf_lut3d.c
index 5a9f552..21206ca 100644
--- a/libavfilter/vf_lut3d.c
+++ b/libavfilter/vf_lut3d.c
@@ -94,7 +94,7 @@ static inline struct rgbvec lerp(const struct rgbvec *v0, const struct rgbvec *v
 
 #define NEAR(x) ((int)((x) + .5))
 #define PREV(x) ((int)(x))
-#define NEXT(x) ((int)(x) + 1)
+#define NEXT(x) (FFMIN((int)(x) + 1, lut3d->lutsize - 1))
 
 /**
  * Get the nearest defined point



More information about the ffmpeg-cvslog mailing list