[FFmpeg-cvslog] imgutils: Fix illegal read.

Thierry Foucu git at videolan.org
Sun Nov 20 03:03:18 CET 2011


ffmpeg | branch: master | Thierry Foucu <tfoucu at gmail.com> | Fri Nov 18 17:36:50 2011 -0800| [c693aa6f71b4f539cf9df67ba42f4b1932981687] | committer: Alex Converse

imgutils: Fix illegal read.

Found with address sanitizer.

Signed-off-by: Alex Converse <alex.converse at gmail.com>

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

 libavutil/imgutils.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c
index 5cd71e2..b734db7 100644
--- a/libavutil/imgutils.c
+++ b/libavutil/imgutils.c
@@ -118,7 +118,7 @@ int av_image_fill_pointers(uint8_t *data[4], enum PixelFormat pix_fmt, int heigh
         has_plane[desc->comp[i].plane] = 1;
 
     total_size = size[0];
-    for (i = 1; has_plane[i] && i < 4; i++) {
+    for (i = 1; i < 4 && has_plane[i]; i++) {
         int h, s = (i == 1 || i == 2) ? desc->log2_chroma_h : 0;
         data[i] = data[i-1] + size[i-1];
         h = (height + (1 << s) - 1) >> s;



More information about the ffmpeg-cvslog mailing list