[FFmpeg-cvslog] av_image_copy: check for av_image_get_linesize() failure.

Michael Niedermayer git at videolan.org
Wed Oct 31 19:17:12 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Oct 31 18:57:21 2012 +0100| [adc39b28a5264591b9f8e5838a752c3d547e8110] | committer: Michael Niedermayer

av_image_copy: check for av_image_get_linesize() failure.

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

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

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

diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c
index 0cff341..b946d6d 100644
--- a/libavutil/imgutils.c
+++ b/libavutil/imgutils.c
@@ -276,6 +276,10 @@ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
         for (i = 0; i < planes_nb; i++) {
             int h = height;
             int bwidth = av_image_get_linesize(pix_fmt, width, i);
+            if (bwidth < 0) {
+                av_log(0, AV_LOG_ERROR, "av_image_get_linesize failed\n");
+                return;
+            }
             if (i == 1 || i == 2) {
                 h= -((-height)>>desc->log2_chroma_h);
             }



More information about the ffmpeg-cvslog mailing list