> -----Original Message----- > From: ffmpeg-devel <ffmpeg-devel-boun...@ffmpeg.org> On Behalf Of Reimar > D?ffinger > Sent: 2020年7月6日 15:32 > To: ffmpeg-devel@ffmpeg.org > Subject: [FFmpeg-devel] [PATCH] dnn_backend_native: Add overflow check for > length calculation. > > We should not silently allocate an incorrect sized buffer. > Fixes trac issue #8718. > TODO1: calculate_operand_dims_count is almost identical code, should they be > merged and its usages check for overflow? > TODO2: the -1 return value seems questionable to me, but is aligned with the > return value used for malloc failure. > Probably both ought to be changed to AVERROR(ENOMEM). > > Signed-off-by: Reimar Döffinger <reimar.doeffin...@gmx.de> > --- > libavfilter/dnn/dnn_backend_native.c | 10 +++++++++- > libavfilter/dnn/dnn_backend_native.h | 2 ++ > libavfilter/dnn/dnn_backend_native_layer_conv2d.c | 2 ++ > libavfilter/dnn/dnn_backend_native_layer_depth2space.c | 2 ++ > libavfilter/dnn/dnn_backend_native_layer_mathbinary.c | 2 ++ > libavfilter/dnn/dnn_backend_native_layer_mathunary.c | 2 ++ > libavfilter/dnn/dnn_backend_native_layer_maximum.c | 2 ++ > libavfilter/dnn/dnn_backend_native_layer_pad.c | 2 ++ > 8 files changed, 23 insertions(+), 1 deletion(-)
thanks, LGTM, will push soon. I'll modify a little to remove the TODO in commit log, and welcome the new patches. I'll also cherry-pick to release 4.3 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".