mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-11 17:55:21 +00:00
libtwolame: prevent a NULL pointer dereference
CC: libav-stable@libav.org
Bug-Id: CID 1250330 / CID 1250335
(cherry picked from commit a42d5c861f
)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
parent
5891fd017a
commit
4d11e4b47d
@ -148,8 +148,8 @@ static int twolame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
|||||||
if (ret < 0) // twolame error
|
if (ret < 0) // twolame error
|
||||||
return AVERROR_UNKNOWN;
|
return AVERROR_UNKNOWN;
|
||||||
|
|
||||||
avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples);
|
|
||||||
if (frame) {
|
if (frame) {
|
||||||
|
avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples);
|
||||||
if (frame->pts != AV_NOPTS_VALUE)
|
if (frame->pts != AV_NOPTS_VALUE)
|
||||||
avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->delay);
|
avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->delay);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user