[FFmpeg-cvslog] avutil/imgutils: Assert that the 2nd av_image_fill_linesizes() call in av_image_fill_linesizes() still succeeds

Michael Niedermayer git at videolan.org
Sun Feb 28 02:03:47 CET 2016


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Wed Feb  3 17:07:26 2016 +0100| [b70e9b4906a3d1a61c542da02793decba1dbabba] | committer: Michael Niedermayer

avutil/imgutils: Assert that the 2nd av_image_fill_linesizes() call in av_image_fill_linesizes() still succeeds

Fixes CID1271742

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c
index 1474482..37808e5 100644
--- a/libavutil/imgutils.c
+++ b/libavutil/imgutils.c
@@ -389,6 +389,7 @@ int av_image_copy_to_buffer(uint8_t *dst, int dst_size,
     int i, j, nb_planes = 0, linesize[4];
     int size = av_image_get_buffer_size(pix_fmt, width, height, align);
     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
+    int ret;
 
     if (size > dst_size || size < 0 || !desc)
         return AVERROR(EINVAL);
@@ -398,7 +399,9 @@ int av_image_copy_to_buffer(uint8_t *dst, int dst_size,
 
     nb_planes++;
 
-    av_image_fill_linesizes(linesize, pix_fmt, width);
+    ret = av_image_fill_linesizes(linesize, pix_fmt, width);
+    av_assert0(ret >= 0); // was checked previously
+
     for (i = 0; i < nb_planes; i++) {
         int h, shift = (i == 1 || i == 2) ? desc->log2_chroma_h : 0;
         const uint8_t *src = src_data[i];



More information about the ffmpeg-cvslog mailing list