]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/oggparseogm.c
avformat/mxfenc: fix typo
[ffmpeg] / libavformat / oggparseogm.c
index ca6b62669d5a5182ed2566cfbe445b8078deef60..a07453760b710be903313e7952a72a2773a8c943 100644 (file)
@@ -176,11 +176,14 @@ ogm_packet(AVFormatContext *s, int idx)
         os->pflags |= AV_PKT_FLAG_KEY;
 
     lb = ((*p & 2) << 1) | ((*p >> 6) & 3);
+    if (os->psize < lb + 1)
+        return AVERROR_INVALIDDATA;
+
     os->pstart += lb + 1;
     os->psize -= lb + 1;
 
     while (lb--)
-        os->pduration += p[lb+1] << (lb*8);
+        os->pduration += (uint64_t)p[lb+1] << (lb*8);
 
     return 0;
 }