Skip to content
Snippets Groups Projects
Commit a1296223 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

lavc: Check CODEC_CAP_VARIABLE_FRAME_SIZE && !frame


This combination is quite odd and almost certainly a bug if
it happens.

Reviewed-by: default avatarJustin Ruggles <justin.ruggles@gmail.com>
Signed-off-by: default avatarMichael Niedermayer <michaelni@gmx.at>
parent af5004b5
No related branches found
No related tags found
No related merge requests found
......@@ -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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment