]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/oggparseopus.c
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavformat / oggparseopus.c
index edcb7b452970acc07c4927108c19fa0efca7ae8b..aafefbbe65bac6ce31df70599bd4cde7c077d084 100644 (file)
@@ -109,6 +109,7 @@ static int opus_packet(AVFormatContext *avf, int idx)
     AVStream *st                 = avf->streams[idx];
     struct oggopus_private *priv = os->private;
     uint8_t *packet              = os->buf + os->pstart;
+    int ret;
 
     if (!os->psize)
         return AVERROR_INVALIDDATA;
@@ -144,7 +145,10 @@ static int opus_packet(AVFormatContext *avf, int idx)
         os->lastdts                 = os->granule - duration;
     }
 
-    os->pduration = opus_duration(packet, os->psize);
+    if ((ret = opus_duration(packet, os->psize)) < 0)
+        return ret;
+
+    os->pduration = ret;
     if (os->lastpts != AV_NOPTS_VALUE) {
         if (st->start_time == AV_NOPTS_VALUE)
             st->start_time = os->lastpts;