Commit a586b3d9 authored by Paul B Mahol's avatar Paul B Mahol

libavcodec/libtwolame: fix null pointer dereference

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent a59808dd
...@@ -152,8 +152,8 @@ static int twolame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, ...@@ -152,8 +152,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 {
......
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