mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-11 17:55:21 +00:00
avfilter/vf_elbg: Check call to avpriv_elbg_do()
Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
73f47846bd
commit
6afad4c7e9
@ -142,7 +142,7 @@ static int config_input(AVFilterLink *inlink)
|
|||||||
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
|
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
|
||||||
{
|
{
|
||||||
ELBGFilterContext *const elbg = inlink->dst->priv;
|
ELBGFilterContext *const elbg = inlink->dst->priv;
|
||||||
int i, j, k;
|
int i, j, k, ret;
|
||||||
uint8_t *p, *p0;
|
uint8_t *p, *p0;
|
||||||
|
|
||||||
const uint8_t r_idx = elbg->rgba_map[R];
|
const uint8_t r_idx = elbg->rgba_map[R];
|
||||||
@ -164,9 +164,14 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* compute the codebook */
|
/* compute the codebook */
|
||||||
avpriv_elbg_do(&elbg->ctx, elbg->codeword, NB_COMPONENTS, elbg->codeword_length,
|
ret = avpriv_elbg_do(&elbg->ctx, elbg->codeword, NB_COMPONENTS,
|
||||||
elbg->codebook, elbg->codebook_length, elbg->max_steps_nb,
|
elbg->codeword_length, elbg->codebook,
|
||||||
|
elbg->codebook_length, elbg->max_steps_nb,
|
||||||
elbg->codeword_closest_codebook_idxs, &elbg->lfg);
|
elbg->codeword_closest_codebook_idxs, &elbg->lfg);
|
||||||
|
if (ret < 0) {
|
||||||
|
av_frame_free(&frame);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
if (elbg->pal8) {
|
if (elbg->pal8) {
|
||||||
AVFilterLink *outlink = inlink->dst->outputs[0];
|
AVFilterLink *outlink = inlink->dst->outputs[0];
|
||||||
|
Loading…
Reference in New Issue
Block a user