Browse Source

libavcodec/libtwolame: fix null pointer dereference

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.4.7
Paul B Mahol Michael Niedermayer 11 years ago
parent
commit
375c1050bf
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/libtwolame.c

+ 1
- 1
libavcodec/libtwolame.c View File

@@ -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 {


Loading…
Cancel
Save