[FFmpeg-cvslog] vf_showinfo: Forward the av_image_get_linesize error

Vittorio Giovara git at videolan.org
Sun Jan 18 00:46:53 CET 2015


ffmpeg | branch: release/2.4 | Vittorio Giovara <vittorio.giovara at gmail.com> | Fri Oct 17 10:07:09 2014 +0100| [2496dbd68b29bd36fbf4753a46163d33f6dae70e] | committer: Vittorio Giovara

vf_showinfo: Forward the av_image_get_linesize error

CC: libav-stable at libav.org
Bug-Id: CID 1087086

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

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

diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c
index cc9ec1c..ede1765 100644
--- a/libavfilter/vf_showinfo.c
+++ b/libavfilter/vf_showinfo.c
@@ -78,9 +78,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
     int i, plane, vsub = desc->log2_chroma_h;
 
     for (plane = 0; frame->data[plane] && plane < 4; plane++) {
-        size_t linesize = av_image_get_linesize(frame->format, frame->width, plane);
         uint8_t *data = frame->data[plane];
         int h = plane == 1 || plane == 2 ? inlink->h >> vsub : inlink->h;
+        int linesize = av_image_get_linesize(frame->format, frame->width, plane);
+        if (linesize < 0)
+            return linesize;
 
         for (i = 0; i < h; i++) {
             plane_checksum[plane] = av_adler32_update(plane_checksum[plane], data, linesize);



More information about the ffmpeg-cvslog mailing list