[FFmpeg-devel,3/3] ffmpeg: assert that audio packet duration in process_input_packet() is non negative

Submitted by Michael Niedermayer on June 13, 2018, 5:10 p.m.

Details

Message ID 20180613171027.12538-3-michael@niedermayer.cc
State New
Headers show

Commit Message

Michael Niedermayer June 13, 2018, 5:10 p.m.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 fftools/ffmpeg.c | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index ba8789a43c..a31994bbdd 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -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_assert0(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;