[FFmpeg-devel] [PATCH 2/2] tests/checkasm/sw_scale.c

Alan Kelly alankelly at google.com
Fri Feb 19 12:01:39 EET 2021


Checks av_mallocs
---
 tests/checkasm/sw_scale.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/checkasm/sw_scale.c b/tests/checkasm/sw_scale.c
index a4866723d7..ef414c0a82 100644
--- a/tests/checkasm/sw_scale.c
+++ b/tests/checkasm/sw_scale.c
@@ -103,7 +103,11 @@ static void check_yuv2yuvX(void)
         for(osi = 0; osi < 64; osi += 16){
             for(fsi = 0; fsi < FILTER_SIZES; ++fsi){
                 src = av_malloc(sizeof(int16_t*) * filter_sizes[fsi]);
+                if(!src)
+                  fail();
                 vFilterData = av_malloc((filter_sizes[fsi] + 2) * sizeof(union VFilterData));
+                if(!vFilterData)
+                  fail();
                 memset(vFilterData, 0, (filter_sizes[fsi] + 2) * sizeof(union VFilterData));
                 for(i = 0; i < filter_sizes[fsi]; ++i){
                     src[i] = &src_pixels[i * LARGEST_INPUT_SIZE];
-- 
2.30.0.617.g56c4b15f3c-goog



More information about the ffmpeg-devel mailing list