aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_showinfo.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-28 00:40:28 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-10-28 00:40:28 +0200
commit2aecfd4f209688a8365f18b351f0ecf12fe5f873 (patch)
treea27bb3f6602ea90f6b13e546a49ea987341a02bc /libavfilter/vf_showinfo.c
parent0f943ed3c8e5839db61958a59300c866680ece3d (diff)
downloadffmpeg-2aecfd4f209688a8365f18b351f0ecf12fe5f873.tar.gz
vf_showinfo: check return code of av_image_get_linesize()
Fixes CID703716 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/vf_showinfo.c')
-rw-r--r--libavfilter/vf_showinfo.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c
index 297e8f195f..07b42db765 100644
--- a/libavfilter/vf_showinfo.c
+++ b/libavfilter/vf_showinfo.c
@@ -52,10 +52,13 @@ static int end_frame(AVFilterLink *inlink)
int i, plane, vsub = desc->log2_chroma_h;
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];
int h = plane == 1 || plane == 2 ? inlink->h >> vsub : inlink->h;
+ if (linesize < 0)
+ return linesize;
+
for (i = 0; i < h; i++) {
plane_checksum[plane] = av_adler32_update(plane_checksum[plane], data, linesize);
checksum = av_adler32_update(checksum, data, linesize);