Browse Source

mpc8: check seektable size before attempting to use it.

Fixes null pointer dereference

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.1
Michael Niedermayer 13 years ago
parent
commit
b61ba262a1
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavformat/mpc8.c

+ 4
- 0
libavformat/mpc8.c View File

@@ -145,6 +145,10 @@ static void mpc8_parse_seektable(AVFormatContext *s, int64_t off)
av_log(s, AV_LOG_ERROR, "No seek table at given position\n");
return;
}
if (size > INT_MAX/10 || size<=0) {
av_log(s, AV_LOG_ERROR, "Seek table size is invalid\n");
return;
}
if(!(buf = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE)))
return;
avio_read(s->pb, buf, size);


Loading…
Cancel
Save