[FFmpeg-cvslog] libavcodec/libtwolame: fix null pointer dereference

Paul B Mahol git at videolan.org
Sun Jan 18 02:33:03 CET 2015


ffmpeg | branch: release/2.4 | Paul B Mahol <onemda at gmail.com> | Mon Oct 13 12:22:41 2014 +0000| [375c1050bf74f28afb83f5190b73425d6ea0775d] | committer: Michael Niedermayer

libavcodec/libtwolame: fix null pointer dereference

Signed-off-by: Paul B Mahol <onemda at gmail.com>
(cherry picked from commit a586b3d9b1df9099c18d3e15c9b261f6612ad2ac)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=375c1050bf74f28afb83f5190b73425d6ea0775d
---

 libavcodec/libtwolame.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/libtwolame.c b/libavcodec/libtwolame.c
index e26454b..098196b 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 {



More information about the ffmpeg-cvslog mailing list