[FFmpeg-cvslog] libtwolame: prevent a NULL pointer dereference
Vittorio Giovara
git at videolan.org
Fri Nov 21 23:03:54 CET 2014
ffmpeg | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Fri Nov 21 11:56:59 2014 +0000| [a42d5c861fea8d18d997c6ba3f4a1d8aa95a288b] | committer: Vittorio Giovara
libtwolame: prevent a NULL pointer dereference
CC: libav-stable at libav.org
Bug-Id: CID 1250330 / CID 1250335
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a42d5c861fea8d18d997c6ba3f4a1d8aa95a288b
---
libavcodec/libtwolame.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/libtwolame.c b/libavcodec/libtwolame.c
index 400985a..ce32941 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 {
More information about the ffmpeg-cvslog
mailing list