summaryrefslogtreecommitdiff
path: root/libavcodec/noise_bsf.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2019-12-23 11:43:57 -0300
committerJames Almer <jamrial@gmail.com>2019-12-23 11:49:44 -0300
commitc75f246a3c077fa552af5dc84abf1d89e9c7d397 (patch)
tree2666c45eccc3ef72865119e6aaaae8203374737f /libavcodec/noise_bsf.c
parentec2a8e339000e3776f34e512e2243c0474c94356 (diff)
downloadffmpeg-c75f246a3c077fa552af5dc84abf1d89e9c7d397.tar.gz
avcodec/noise_bsf: remove superfluous fail label
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/noise_bsf.c')
-rw-r--r--libavcodec/noise_bsf.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/libavcodec/noise_bsf.c b/libavcodec/noise_bsf.c
index d79f63b777..721fd217ec 100644
--- a/libavcodec/noise_bsf.c
+++ b/libavcodec/noise_bsf.c
@@ -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)