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
205205 } hspace_elem;
206206
207207 /* houghspace */
208− hspace_elem** hspace = av_malloc_array(MAX_FRAMERATE, sizeof(hspace_elem *));
208+ hspace_elem **hspace = av_mallocz(MAX_FRAMERATE * sizeof(*hspace));
209209
210+ if (!hspace)
211+ return NULL;
210212 /* initialize houghspace */
211213 for (i = 0; i < MAX_FRAMERATE; i++) {
212214 hspace[i] = av_malloc_array(2 * HOUGH_MAX_OFFSET + 1, sizeof(hspace_elem));
215+ if (!hspace[i])
216+ goto error;
213217 for (j = 0; j < 2 * HOUGH_MAX_OFFSET + 1; j++) {
214218 hspace[i][j].score = 0;
215219 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