From d10dc61682b057d6f3a59aa23353e4f155f16d11 Mon Sep 17 00:00:00 2001
From: Alex Beregszaszi <alex@rtfs.hu>
Date: Wed, 12 Oct 2005 22:40:10 +0000
Subject: [PATCH] sanity check whether dimensions are non-null

Originally committed as revision 4634 to svn://svn.ffmpeg.org/ffmpeg/trunk
---
 libavcodec/imgresample.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/imgresample.c b/libavcodec/imgresample.c
index 53471f4510e..d423f388cce 100644
--- a/libavcodec/imgresample.c
+++ b/libavcodec/imgresample.c
@@ -558,6 +558,9 @@ ImgReSampleContext *img_resample_full_init(int owidth, int oheight,
 {
     ImgReSampleContext *s;
 
+    if (!owidth || !oheight || !iwidth || !iheight)
+	return NULL;
+
     s = av_mallocz(sizeof(ImgReSampleContext));
     if (!s)
         return NULL;
-- 
GitLab