avfilter/signature_lookup: dont leave uncleared pointers in sll_free()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 6c504829514333439d15deb5717567fb4bdbbee0) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
16bef72c50
commit
c5dcf99399
@ -37,6 +37,16 @@
|
|||||||
#define STATUS_END_REACHED 1
|
#define STATUS_END_REACHED 1
|
||||||
#define STATUS_BEGIN_REACHED 2
|
#define STATUS_BEGIN_REACHED 2
|
||||||
|
|
||||||
|
static void sll_free(MatchingInfo **sll)
|
||||||
|
{
|
||||||
|
while (*sll) {
|
||||||
|
MatchingInfo *tmp = *sll;
|
||||||
|
*sll = tmp->next;
|
||||||
|
tmp->next = NULL;
|
||||||
|
av_free(tmp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void fill_l1distlut(uint8_t lut[])
|
static void fill_l1distlut(uint8_t lut[])
|
||||||
{
|
{
|
||||||
int i, j, tmp_i, tmp_j,count;
|
int i, j, tmp_i, tmp_j,count;
|
||||||
@ -520,16 +530,6 @@ static MatchingInfo evaluate_parameters(AVFilterContext *ctx, SignatureContext *
|
|||||||
return bestmatch;
|
return bestmatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sll_free(MatchingInfo *sll)
|
|
||||||
{
|
|
||||||
void *tmp;
|
|
||||||
while (sll) {
|
|
||||||
tmp = sll;
|
|
||||||
sll = sll->next;
|
|
||||||
av_freep(&tmp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static MatchingInfo lookup_signatures(AVFilterContext *ctx, SignatureContext *sc, StreamContext *first, StreamContext *second, int mode)
|
static MatchingInfo lookup_signatures(AVFilterContext *ctx, SignatureContext *sc, StreamContext *first, StreamContext *second, int mode)
|
||||||
{
|
{
|
||||||
CoarseSignature *cs, *cs2;
|
CoarseSignature *cs, *cs2;
|
||||||
@ -572,7 +572,7 @@ static MatchingInfo lookup_signatures(AVFilterContext *ctx, SignatureContext *sc
|
|||||||
"ratio %f, offset %d, score %d, %d frames matching\n",
|
"ratio %f, offset %d, score %d, %d frames matching\n",
|
||||||
bestmatch.first->index, bestmatch.second->index,
|
bestmatch.first->index, bestmatch.second->index,
|
||||||
bestmatch.framerateratio, bestmatch.offset, bestmatch.score, bestmatch.matchframes);
|
bestmatch.framerateratio, bestmatch.offset, bestmatch.score, bestmatch.matchframes);
|
||||||
sll_free(infos);
|
sll_free(&infos);
|
||||||
}
|
}
|
||||||
} while (find_next_coarsecandidate(sc, second->coarsesiglist, &cs, &cs2, 0) && !bestmatch.whole);
|
} while (find_next_coarsecandidate(sc, second->coarsesiglist, &cs, &cs2, 0) && !bestmatch.whole);
|
||||||
return bestmatch;
|
return bestmatch;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user