summaryrefslogtreecommitdiff
path: root/libavutil
diff options
context:
space:
mode:
authorThierry Foucu <tfoucu@gmail.com>2011-11-18 17:36:50 -0800
committerAlex Converse <alex.converse@gmail.com>2011-11-18 17:42:49 -0800
commitc693aa6f71b4f539cf9df67ba42f4b1932981687 (patch)
tree0b7d3642aad2327d93ee036a356a090ea8c725ed /libavutil
parentff3755cbde9bdd2a4dc50e4432f72ddeef1a85ac (diff)
downloadffmpeg-c693aa6f71b4f539cf9df67ba42f4b1932981687.tar.gz
imgutils: Fix illegal read.
Found with address sanitizer. Signed-off-by: Alex Converse <alex.converse@gmail.com>
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/imgutils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c
index 5cd71e21ce..b734db7bb1 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;