Commit 2aecfd4f authored by Michael Niedermayer's avatar Michael Niedermayer

vf_showinfo: check return code of av_image_get_linesize()

Fixes CID703716
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 0f943ed3
...@@ -52,10 +52,13 @@ static int end_frame(AVFilterLink *inlink) ...@@ -52,10 +52,13 @@ static int end_frame(AVFilterLink *inlink)
int i, plane, vsub = desc->log2_chroma_h; int i, plane, vsub = desc->log2_chroma_h;
for (plane = 0; picref->data[plane] && plane < 4; plane++) { for (plane = 0; picref->data[plane] && plane < 4; plane++) {
size_t linesize = av_image_get_linesize(picref->format, picref->video->w, plane); int64_t linesize = av_image_get_linesize(picref->format, picref->video->w, plane);
uint8_t *data = picref->data[plane]; uint8_t *data = picref->data[plane];
int h = plane == 1 || plane == 2 ? inlink->h >> vsub : inlink->h; int h = plane == 1 || plane == 2 ? inlink->h >> vsub : inlink->h;
if (linesize < 0)
return linesize;
for (i = 0; i < h; i++) { for (i = 0; i < h; i++) {
plane_checksum[plane] = av_adler32_update(plane_checksum[plane], data, linesize); plane_checksum[plane] = av_adler32_update(plane_checksum[plane], data, linesize);
checksum = av_adler32_update(checksum, data, linesize); checksum = av_adler32_update(checksum, data, linesize);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment