This is used to check if the input buffer is larger enough, so if this overflows it can cause a false negative leading to a segmentation fault in bytestream2_get_bufferu.
Signed-off-by: Andreas Cadhalpun <andreas.cadhal...@googlemail.com> --- libavcodec/xwddec.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/xwddec.c b/libavcodec/xwddec.c index 2febedc..311eeec 100644 --- a/libavcodec/xwddec.c +++ b/libavcodec/xwddec.c @@ -127,6 +127,12 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data, return AVERROR_INVALIDDATA; } + if (lsize > UINT_MAX / avctx->height) { + av_log(avctx, AV_LOG_ERROR, "lsize %u too large for height %d\n", + lsize, avctx->height); + return AVERROR_INVALIDDATA; + } + if (ncolors > 256) { av_log(avctx, AV_LOG_ERROR, "invalid number of entries in colormap\n"); return AVERROR_INVALIDDATA; -- 2.6.2 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel