History

avfilter/signature_lookup: Check for allocation error

Andreas Rheinhardt committed 2 years ago

Commit eeb99dc1 parent c149d861 file · +5 −1Browse files

Unified · Split

libavfilter/signature_lookup.c+5−1
@@ -205,11 +205,15 @@ static MatchingInfo* get_matching_parameters(AVFilterContext *ctx, SignatureCont · 204 unmodified lines
205 } hspace_elem;205 } hspace_elem;
206 206
207 /* houghspace */207 /* houghspace */
208 hspace_elem** hspace = av_malloc_array(MAX_FRAMERATE, sizeof(hspace_elem *));208 hspace_elem **hspace = av_mallocz(MAX_FRAMERATE * sizeof(*hspace));
209 209
210 if (!hspace)
211 return NULL;
210 /* initialize houghspace */212 /* initialize houghspace */
211 for (i = 0; i < MAX_FRAMERATE; i++) {213 for (i = 0; i < MAX_FRAMERATE; i++) {
212 hspace[i] = av_malloc_array(2 * HOUGH_MAX_OFFSET + 1, sizeof(hspace_elem));214 hspace[i] = av_malloc_array(2 * HOUGH_MAX_OFFSET + 1, sizeof(hspace_elem));
215 if (!hspace[i])
216 goto error;
213 for (j = 0; j < 2 * HOUGH_MAX_OFFSET + 1; j++) {217 for (j = 0; j < 2 * HOUGH_MAX_OFFSET + 1; j++) {
214 hspace[i][j].score = 0;218 hspace[i][j].score = 0;
215 hspace[i][j].dist = 99999;219 hspace[i][j].dist = 99999;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t