summaryrefslogtreecommitdiff
path: root/libavfilter/vf_showinfo.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-08-03 18:54:43 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-08-03 19:15:46 +0200
commite43a0a232dbf6d3c161823c2e07c52e76227a1bc (patch)
tree6ccf4fedf12be91e9de6f73fee41d202612916b5 /libavfilter/vf_showinfo.c
parentbc4e7985628134496104e32f37f811aab4f68c55 (diff)
downloadffmpeg-e43a0a232dbf6d3c161823c2e07c52e76227a1bc.tar.gz
avfilter: fix plane validity checks
Fixes out of array accesses Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/vf_showinfo.c')
-rw-r--r--libavfilter/vf_showinfo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c
index 336a870b17..82becc40f4 100644
--- a/libavfilter/vf_showinfo.c
+++ b/libavfilter/vf_showinfo.c
@@ -38,7 +38,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
uint32_t plane_checksum[4] = {0}, checksum = 0;
int i, plane, vsub = desc->log2_chroma_h;
- for (plane = 0; plane < 4 && frame->data[plane]; plane++) {
+ for (plane = 0; plane < 4 && frame->data[plane] && frame->linesize[plane]; plane++) {
int64_t linesize = av_image_get_linesize(frame->format, frame->width, plane);
uint8_t *data = frame->data[plane];
int h = plane == 1 || plane == 2 ? FF_CEIL_RSHIFT(inlink->h, vsub) : inlink->h;
@@ -68,7 +68,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
av_get_picture_type_char(frame->pict_type),
checksum, plane_checksum[0]);
- for (plane = 1; plane < 4 && frame->data[plane]; plane++)
+ for (plane = 1; plane < 4 && frame->data[plane] && frame->linesize[plane]; plane++)
av_log(ctx, AV_LOG_INFO, " %08X", plane_checksum[plane]);
av_log(ctx, AV_LOG_INFO, "]\n");