1
0
Fork 0

avfilter/signature_lookup: Check for allocation error

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2024-02-14 00:45:28 +01:00
parent c149d86760
commit eeb99dcb51
1 changed files with 5 additions and 1 deletions

View File

@ -205,11 +205,15 @@ static MatchingInfo* get_matching_parameters(AVFilterContext *ctx, SignatureCont
} hspace_elem;
/* houghspace */
hspace_elem** hspace = av_malloc_array(MAX_FRAMERATE, sizeof(hspace_elem *));
hspace_elem **hspace = av_mallocz(MAX_FRAMERATE * sizeof(*hspace));
if (!hspace)
return NULL;
/* initialize houghspace */
for (i = 0; i < MAX_FRAMERATE; i++) {
hspace[i] = av_malloc_array(2 * HOUGH_MAX_OFFSET + 1, sizeof(hspace_elem));
if (!hspace[i])
goto error;
for (j = 0; j < 2 * HOUGH_MAX_OFFSET + 1; j++) {
hspace[i][j].score = 0;
hspace[i][j].dist = 99999;