Browse Source

flvdec: Check for overflow before allocating arrays

On allocation, the array length is multiplied by sizeof(int64_t),
this prevents the multiplication from overflowing.

Signed-off-by: Martin Storsjö <martin@martin.st>
tags/n0.9
Michael Niedermayer Martin Storsjö 13 years ago
parent
commit
a246cefa75
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      libavformat/flvdec.c

+ 3
- 0
libavformat/flvdec.c View File

@@ -161,6 +161,9 @@ static int parse_keyframes_index(AVFormatContext *s, AVIOContext *ioc, AVStream
break;

arraylen = avio_rb32(ioc);
if (arraylen >> 28)
break;

/*
* Expect only 'times' or 'filepositions' sub-arrays in other case refuse to use such metadata
* for indexing


Loading…
Cancel
Save