mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avcodec/noise_bsf: remove superfluous fail label
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
ec2a8e3390
commit
c75f246a3c
@ -39,7 +39,7 @@ static int noise(AVBSFContext *ctx, AVPacket *pkt)
|
||||
{
|
||||
NoiseContext *s = ctx->priv_data;
|
||||
int amount = s->amount > 0 ? s->amount : (s->state % 10001 + 1);
|
||||
int i, ret = 0;
|
||||
int i, ret;
|
||||
|
||||
if (amount <= 0)
|
||||
return AVERROR(EINVAL);
|
||||
@ -55,19 +55,18 @@ static int noise(AVBSFContext *ctx, AVPacket *pkt)
|
||||
}
|
||||
|
||||
ret = av_packet_make_writable(pkt);
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
if (ret < 0) {
|
||||
av_packet_unref(pkt);
|
||||
return ret;
|
||||
}
|
||||
|
||||
for (i = 0; i < pkt->size; i++) {
|
||||
s->state += pkt->data[i] + 1;
|
||||
if (s->state % amount == 0)
|
||||
pkt->data[i] = s->state;
|
||||
}
|
||||
fail:
|
||||
if (ret < 0)
|
||||
av_packet_unref(pkt);
|
||||
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define OFFSET(x) offsetof(NoiseContext, x)
|
||||
|
Loading…
Reference in New Issue
Block a user