summaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_lut.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2011-07-02 15:06:02 +0200
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2011-07-02 15:21:05 +0200
commit2b550beb2299e30d5fc13596c619457c13b49d5f (patch)
tree44a973100301e528b0b5818eff7c226d11be2a56 /libavfilter/vf_lut.c
parent25119a7f082ba2432df528f70348f5bd83aa8c07 (diff)
downloadffmpeg-streaming-2b550beb2299e30d5fc13596c619457c13b49d5f.zip
ffmpeg-streaming-2b550beb2299e30d5fc13596c619457c13b49d5f.tar.gz
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).
Diffstat (limited to 'libavfilter/vf_lut.c')
-rw-r--r--libavfilter/vf_lut.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/vf_lut.c b/libavfilter/vf_lut.c
index 8607ee9..b74aa23 100644
--- a/libavfilter/vf_lut.c
+++ b/libavfilter/vf_lut.c
@@ -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;
OpenPOWER on IntegriCloud