aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/libtwolame.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2014-11-21 11:56:59 +0000
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-11-21 12:27:07 +0000
commita42d5c861fea8d18d997c6ba3f4a1d8aa95a288b (patch)
tree930fe14992d605df04700ca590964b62e97621cd /libavcodec/libtwolame.c
parent863ee8a855b8ce27ffef41479eb66da58763faed (diff)
downloadffmpeg-a42d5c861fea8d18d997c6ba3f4a1d8aa95a288b.tar.gz
libtwolame: prevent a NULL pointer dereference
CC: libav-stable@libav.org Bug-Id: CID 1250330 / CID 1250335
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 400985ad32..ce3294126a 100644
--- a/libavcodec/libtwolame.c
+++ b/libavcodec/libtwolame.c
@@ -148,8 +148,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->initial_padding);
} else {