Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-08-03 20:54:43 +0400
committerMichael Niedermayer <michaelni@gmx.at>2013-08-03 21:15:46 +0400
commite43a0a232dbf6d3c161823c2e07c52e76227a1bc (patch)
tree6ccf4fedf12be91e9de6f73fee41d202612916b5 /libavfilter/vf_pad.c
parentbc4e7985628134496104e32f37f811aab4f68c55 (diff)
avfilter: fix plane validity checks
Fixes out of array accesses Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/vf_pad.c')
-rw-r--r--libavfilter/vf_pad.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/vf_pad.c b/libavfilter/vf_pad.c
index 2e9aa56968..023ef7f863 100644
--- a/libavfilter/vf_pad.c
+++ b/libavfilter/vf_pad.c
@@ -214,7 +214,7 @@ static AVFrame *get_video_buffer(AVFilterLink *inlink, int w, int h)
frame->width = w;
frame->height = h;
- for (plane = 0; plane < 4 && frame->data[plane]; plane++) {
+ for (plane = 0; plane < 4 && frame->data[plane] && frame->linesize[plane]; plane++) {
int hsub = s->draw.hsub[plane];
int vsub = s->draw.vsub[plane];
frame->data[plane] += (s->x >> hsub) * s->draw.pixelstep[plane] +
@@ -311,7 +311,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
int i;
out = in;
- for (i = 0; i < 4 && out->data[i]; i++) {
+ for (i = 0; i < 4 && out->data[i] && out->linesize[i]; i++) {
int hsub = s->draw.hsub[i];
int vsub = s->draw.vsub[i];
out->data[i] -= (s->x >> hsub) * s->draw.pixelstep[i] +