Fixes: CID 1403229 Dereference after null check
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -299,6 +299,11 @@ static MatchingInfo* get_matching_parameters(AVFilterContext *ctx, SignatureCont · 298 unmodified lines | ||
| 299 | 299 | if (!c->next) |
| 300 | 300 | av_log(ctx, AV_LOG_FATAL, "Could not allocate memory"); |
| 301 | 301 | c = c->next; |
| 302 | + | |
| 303 | + } | |
| 304 | + if (!c) { | |
| 305 | + sll_free(&cands); | |
| 306 | + goto error; | |
| 302 | 307 | } |
| 303 | 308 | c->framerateratio = (i+1.0) / 30; |
| 304 | 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 | 324 | for (i = 0; i < MAX_FRAMERATE; i++) { |
| 319 | 325 | av_freep(&hspace[i]); |
| 320 | 326 | } |