Message ID | 20240205114459.8317-2-michael@niedermayer.cc |
---|---|
State | Accepted |
Commit | 98ae1ad7cf16bd10a4fa79f676439edc4da7cba6 |
Headers | show |
Series | [FFmpeg-devel,1/2] avfilter/signature_lookup: dont leave uncleared pointers in sll_free() | expand |
Context | Check | Description |
---|---|---|
yinshiyou/make_loongarch64 | success | Make finished |
yinshiyou/make_fate_loongarch64 | success | Make fate finished |
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
On Mon, Feb 05, 2024 at 12:44:59PM +0100, Michael Niedermayer wrote: > Fixes: CID 1403229 Dereference after null check > > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> > --- > libavfilter/signature_lookup.c | 6 ++++++ > 1 file changed, 6 insertions(+) will apply [...]
diff --git a/libavfilter/signature_lookup.c b/libavfilter/signature_lookup.c index 52a97e1bc7e..0c724456e24 100644 --- a/libavfilter/signature_lookup.c +++ b/libavfilter/signature_lookup.c @@ -298,6 +298,11 @@ static MatchingInfo* get_matching_parameters(AVFilterContext *ctx, SignatureCont if (!c->next) av_log(ctx, AV_LOG_FATAL, "Could not allocate memory"); c = c->next; + + } + if (!c) { + sll_free(&cands); + goto error; } c->framerateratio = (i+1.0) / 30; c->score = hspace[i][j].score; @@ -314,6 +319,7 @@ static MatchingInfo* get_matching_parameters(AVFilterContext *ctx, SignatureCont } } } + error: for (i = 0; i < MAX_FRAMERATE; i++) { av_freep(&hspace[i]); }
Fixes: CID 1403229 Dereference after null check Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavfilter/signature_lookup.c | 6 ++++++ 1 file changed, 6 insertions(+)