Commit a1296223 authored by Michael Niedermayer's avatar Michael Niedermayer

lavc: Check CODEC_CAP_VARIABLE_FRAME_SIZE && !frame

This combination is quite odd and almost certainly a bug if
it happens.
Reviewed-by: 's avatarJustin Ruggles <justin.ruggles@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent af5004b5
......@@ -968,6 +968,8 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
if (!user_packet) {
if (avctx->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE) {
av_assert0(av_get_bits_per_sample(avctx->codec_id) != 0);
if (!frame)
return AVERROR(EINVAL);
buf_size = nb_samples * avctx->channels *
av_get_bits_per_sample(avctx->codec_id) / 8;
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment