@@ -65,7 +65,6 @@ static av_cold int adpcm_encode_init(AVCodecContext *avctx)
ADPCMEncodeContext *s = avctx->priv_data;
uint8_t *extradata;
int i;
- int ret = AVERROR(ENOMEM);
if (avctx->channels > 2) {
av_log(avctx, AV_LOG_ERROR, "only stereo or mono is supported\n");
@@ -120,7 +119,7 @@ static av_cold int adpcm_encode_init(AVCodecContext *avctx)
avctx->bits_per_coded_sample = 4;
avctx->block_align = BLKSIZE;
if (!(avctx->extradata = av_malloc(32 + AV_INPUT_BUFFER_PADDING_SIZE)))
- goto error;
+ return AVERROR(ENOMEM);
avctx->extradata_size = 32;
extradata = avctx->extradata;
bytestream_put_le16(&extradata, avctx->frame_size);
@@ -140,8 +139,7 @@ static av_cold int adpcm_encode_init(AVCodecContext *avctx)
avctx->sample_rate != 44100) {
av_log(avctx, AV_LOG_ERROR, "Sample rate must be 11025, "
"22050 or 44100\n");
- ret = AVERROR(EINVAL);
- goto error;
+ return AVERROR(EINVAL);
}
avctx->frame_size = 512 * (avctx->sample_rate / 11025);
break;
@@ -150,13 +148,10 @@ static av_cold int adpcm_encode_init(AVCodecContext *avctx)
avctx->block_align = BLKSIZE;
break;
default:
- ret = AVERROR(EINVAL);
- goto error;
+ return AVERROR(EINVAL);
}
return 0;
-error:
- return ret;
}
static av_cold int adpcm_encode_close(AVCodecContext *avctx)
@@ -725,8 +720,6 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
avpkt->size = pkt_size;
*got_packet_ptr = 1;
return 0;
-error:
- return AVERROR(ENOMEM);
}
static const enum AVSampleFormat sample_fmts[] = {