Browse Source

vf_lut: add plane validity check in draw_slice()

The value for inpic->data[plane] with plane >=4 is undefined, and it
will contain in general random data. This change adds a check for
exiting the loop when plane reaches the value 4.

Fix crash (occurring for example with: format=rgba,lut).
tags/n0.9
Stefano Sabatini 14 years ago
parent
commit
2b550beb22
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavfilter/vf_lut.c

+ 1
- 1
libavfilter/vf_lut.c View File

@@ -319,7 +319,7 @@ static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
}
} else {
/* planar */
for (plane = 0; inpic->data[plane]; plane++) {
for (plane = 0; plane < 4 && inpic->data[plane]; plane++) {
int vsub = plane == 1 || plane == 2 ? lut->vsub : 0;
int hsub = plane == 1 || plane == 2 ? lut->hsub : 0;



Loading…
Cancel
Save