ffmpeg: assert that audio packet duration in process_input_packet() is non negative
authorMichael Niedermayer <michael@niedermayer.cc>
Wed, 13 Jun 2018 14:50:39 +0000 (16:50 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 14 Jun 2018 16:55:45 +0000 (18:55 +0200)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
fftools/ffmpeg.c

index ba8789a..50c2fa5 100644 (file)
@@ -2710,6 +2710,7 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo
         ist->dts = ist->next_dts;
         switch (ist->dec_ctx->codec_type) {
         case AVMEDIA_TYPE_AUDIO:
+            av_assert1(pkt->duration >= 0);
             if (ist->dec_ctx->sample_rate) {
                 ist->next_dts += ((int64_t)AV_TIME_BASE * ist->dec_ctx->frame_size) /
                                   ist->dec_ctx->sample_rate;