[FFmpeg-devel] [PATCH] Matroska MAX_STREAMS boundscheck

Roine Gustafsson roine
Mon Jan 7 07:36:40 CET 2008


Enforce MAX_STREAMS for Matroska.

   /Roine


--- matroskadec.c.old   2007-12-31 17:44:50.000000000 +0100
+++ matroskadec.c       2008-01-07 04:36:18.000000000 +0100
@@ -1470,7 +1470,13 @@
          switch (id) {
              /* one track within the "all-tracks" header */
              case MATROSKA_ID_TRACKENTRY:
+                if (matroska->num_tracks < MAX_STREAMS) {
                  res = matroska_add_stream(matroska);
+                } else {
+                    av_log(matroska->ctx, AV_LOG_WARNING,
+                           "Too many tracks: ignoring track\n");
+                    res = ebml_read_skip(matroska);
+                }
                  break;

              default:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: matroska.diff
Type: application/octet-stream
Size: 644 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080107/d3d9a59f/attachment.obj>



More information about the ffmpeg-devel mailing list