aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/libtwolame.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2014-10-13 12:22:41 +0000
committerPaul B Mahol <onemda@gmail.com>2014-10-13 12:22:41 +0000
commita586b3d9b1df9099c18d3e15c9b261f6612ad2ac (patch)
tree170c2d3a6bac9ed0393d6809e28ba563f445d44f /libavcodec/libtwolame.c
parenta59808dd57f81d1cfaa76e2624a66825e63324ea (diff)
downloadffmpeg-a586b3d9b1df9099c18d3e15c9b261f6612ad2ac.tar.gz
libavcodec/libtwolame: fix null pointer dereference
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/libtwolame.c')
-rw-r--r--libavcodec/libtwolame.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/libtwolame.c b/libavcodec/libtwolame.c
index e26454bb84..098196b0c1 100644
--- a/libavcodec/libtwolame.c
+++ b/libavcodec/libtwolame.c
@@ -152,8 +152,8 @@ static int twolame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
if (ret < 0) // twolame error
return AVERROR_UNKNOWN;
- avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples);
if (frame) {
+ avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples);
if (frame->pts != AV_NOPTS_VALUE)
avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->delay);
} else {