aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Foucu <tfoucu@gmail.com>2011-11-18 17:36:50 -0800
committerMichael Niedermayer <michaelni@gmx.at>2011-11-21 16:48:18 +0100
commit4007352bd054936fe06cb8b726db008b47101d91 (patch)
tree9621ed64ba0514002a55b6d042df45b882b0cbf2
parent5c6a2d9878f12da2730e06fbcc79f35d82f906cf (diff)
downloadffmpeg-4007352bd054936fe06cb8b726db008b47101d91.tar.gz
imgutils: Fix illegal read.
Found with address sanitizer. Signed-off-by: Alex Converse <alex.converse@gmail.com> (cherry picked from commit c693aa6f71b4f539cf9df67ba42f4b1932981687) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavutil/imgutils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c
index e04c307f62..5033d0d4c1 100644
--- a/libavutil/imgutils.c
+++ b/libavutil/imgutils.c
@@ -125,7 +125,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;