From 0ecca7a49f8e254c12a3a1de048d738bfbb614c6 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 12 Jan 2005 00:16:25 +0000 Subject: various security fixes and precautionary checks Originally committed as revision 3822 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/imgresample.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavcodec/imgresample.c') diff --git a/libavcodec/imgresample.c b/libavcodec/imgresample.c index b4c5f360ad..3b74a82794 100644 --- a/libavcodec/imgresample.c +++ b/libavcodec/imgresample.c @@ -561,6 +561,8 @@ ImgReSampleContext *img_resample_full_init(int owidth, int oheight, s = av_mallocz(sizeof(ImgReSampleContext)); if (!s) return NULL; + if((unsigned)owidth >= UINT_MAX / (LINE_BUF_HEIGHT + NB_TAPS)) + return NULL; s->line_buf = av_mallocz(owidth * (LINE_BUF_HEIGHT + NB_TAPS)); if (!s->line_buf) goto fail; -- cgit v1.2.3