Otherwise one could read into the frame's padding when one encounters the small last frame.
Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com> --- With this patch the last few samples of the last frame will be ignored. It would be possible to avoid that by padding the frame to a multiple of four samples. This could be done with a new codec cap/flag; the existing padding code could be reused for this. libavcodec/aptxenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/aptxenc.c b/libavcodec/aptxenc.c index 5ea6053c26..effab86b61 100644 --- a/libavcodec/aptxenc.c +++ b/libavcodec/aptxenc.c @@ -215,7 +215,7 @@ static int aptx_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, if ((ret = ff_af_queue_add(&s->afq, frame)) < 0) return ret; - output_size = s->block_size * frame->nb_samples/4; + output_size = s->block_size * (frame->nb_samples/4); if ((ret = ff_get_encode_buffer(avctx, avpkt, output_size, 0)) < 0) return ret; -- 2.30.2 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".