Re: [FFmpeg-devel] [PATCH] avfilter/tests/integral: Check malloc fail before using it
On Tue, Feb 12, 2019 at 1:48 AM Michael Niedermayer wrote: > > On Sun, Feb 10, 2019 at 01:07:20PM +0800, Jun Zhao wrote: > > Need to check malloc fail before using it, so adjust the location > > in the code. > > > > Signed-off-by: Jun Zhao > > --- > > libavfilter/tests/integral.c |6 +++--- > > 1 files changed, 3 insertions(+), 3 deletions(-) > > LGTM > > thx > > Pushed, Tks ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avfilter/tests/integral: Check malloc fail before using it
On Sun, Feb 10, 2019 at 01:07:20PM +0800, Jun Zhao wrote: > Need to check malloc fail before using it, so adjust the location > in the code. > > Signed-off-by: Jun Zhao > --- > libavfilter/tests/integral.c |6 +++--- > 1 files changed, 3 insertions(+), 3 deletions(-) LGTM thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The real ebay dictionary, page 2 "100% positive feedback" - "All either got their money back or didnt complain" "Best seller ever, very honest" - "Seller refunded buyer after failed scam" signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avfilter/tests/integral: Check malloc fail before using it
Need to check malloc fail before using it, so adjust the location in the code. Signed-off-by: Jun Zhao --- libavfilter/tests/integral.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libavfilter/tests/integral.c b/libavfilter/tests/integral.c index 2a8e8ff..361bfd5 100644 --- a/libavfilter/tests/integral.c +++ b/libavfilter/tests/integral.c @@ -54,6 +54,9 @@ int main(void) uint32_t *ii = av_mallocz_array(ii_h + 1, ii_lz_32 * sizeof(*ii)); uint32_t *ii2 = av_mallocz_array(ii_h + 1, ii_lz_32 * sizeof(*ii2)); +if (!ii || !ii2) +return -1; + uint32_t *ii_start = ii + ii_lz_32 + 1; // skip top 0-line and left 0-column uint32_t *ii_start2 = ii2 + ii_lz_32 + 1; // skip top 0-line and left 0-column @@ -61,9 +64,6 @@ int main(void) ff_nlmeans_init(); -if (!ii || !ii2) -return -1; - for (yoff = -e; yoff <= e; yoff++) { for (xoff = -e; xoff <= e; xoff++) { printf("xoff=%d yoff=%d\n", xoff, yoff); -- 1.7.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel