Fixup 3 - remove small risk of crash if encode_setup called incorrectly

This commit is contained in:
ejurgensen 2019-02-17 16:41:37 +01:00
parent de55acf797
commit 201c97fdf8
1 changed files with 2 additions and 1 deletions

View File

@ -340,6 +340,7 @@ make_wav_header(struct encode_ctx *ctx, struct decode_ctx *src_ctx, off_t *est_s
bps = av_get_bits_per_sample(ctx->settings.audio_codec);
wav_len = ctx->settings.channels * (bps / 8) * ctx->settings.sample_rate * (duration / 1000);
if (est_size)
*est_size = wav_len + sizeof(ctx->header);
memcpy(ctx->header, "RIFF", 4);