From: Michael Niedermayer <[email protected]> This combination is quite odd and almost certainly a bug if it happens.
Signed-off-by: Michael Niedermayer <[email protected]> Signed-off-by: Justin Ruggles <[email protected]> --- libavcodec/utils.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 9a12fe7..64d6c25 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -894,6 +894,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 { -- 1.7.1 _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
