History

avfilter/signature_lookup: Do not dereference NULL pointers after malloc failure

Fixes: CID 1403229 Dereference after null check

Michael Niedermayer committed 2 years ago

Commit 98ae1ad1 parent 6c504821 file · +6 −0Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/signature_lookup.c+6−0
@@ -299,6 +299,11 @@ static MatchingInfo* get_matching_parameters(AVFilterContext *ctx, SignatureCont · 298 unmodified lines
299 if (!c->next)299 if (!c->next)
300 av_log(ctx, AV_LOG_FATAL, "Could not allocate memory");300 av_log(ctx, AV_LOG_FATAL, "Could not allocate memory");
301 c = c->next;301 c = c->next;
302
303 }
304 if (!c) {
305 sll_free(&cands);
306 goto error;
302 }307 }
303 c->framerateratio = (i+1.0) / 30;308 c->framerateratio = (i+1.0) / 30;
304 c->score = hspace[i][j].score;309 c->score = hspace[i][j].score;
@@ -315,6 +320,7 @@ static MatchingInfo* get_matching_parameters(AVFilterContext *ctx, SignatureCont · 10 unmodified lines
315 }320 }
316 }321 }
317 }322 }
323 error:
318 for (i = 0; i < MAX_FRAMERATE; i++) {324 for (i = 0; i < MAX_FRAMERATE; i++) {
319 av_freep(&hspace[i]);325 av_freep(&hspace[i]);
320 }326 }

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