[FFmpeg-cvslog] vf_showinfo: check return code of av_image_get_linesize()

Michael Niedermayer git at videolan.org
Sun Oct 28 00:46:32 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Oct 28 00:40:28 2012 +0200| [2aecfd4f209688a8365f18b351f0ecf12fe5f873] | committer: Michael Niedermayer

vf_showinfo: check return code of av_image_get_linesize()

Fixes CID703716
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2aecfd4f209688a8365f18b351f0ecf12fe5f873
---

 libavfilter/vf_showinfo.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c
index 297e8f1..07b42db 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);



More information about the ffmpeg-cvslog mailing list