diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-10-31 18:57:21 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-10-31 19:12:48 +0100 |
commit | adc39b28a5264591b9f8e5838a752c3d547e8110 (patch) | |
tree | 223e3dfb599f12986ed0d57f81b2b6e0bac5a32f /libavutil/imgutils.c | |
parent | 6992b0bfc2f5276918b45a6e42c8c6c56b35b994 (diff) | |
download | ffmpeg-adc39b28a5264591b9f8e5838a752c3d547e8110.tar.gz |
av_image_copy: check for av_image_get_linesize() failure.
Fixes CID703722
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/imgutils.c')
-rw-r--r-- | libavutil/imgutils.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c index 0cff34123c..b946d6dc0c 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); } |