aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/sierravmd.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2006-05-13 11:37:56 +0000
committerMichael Niedermayer <michaelni@gmx.at>2006-05-13 11:37:56 +0000
commita443a2530d00b7019269202ac0f5ca8ba0a021c7 (patch)
tree9dfe3c9388c09a10ef32b64a871d3dac45495cb5 /libavformat/sierravmd.c
parent3a1a7e32ace7af47de74e8ae779cb4e04c89aa97 (diff)
downloadffmpeg-a443a2530d00b7019269202ac0f5ca8ba0a021c7.tar.gz
sanity checks some might have been exploitable
Originally committed as revision 5370 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/sierravmd.c')
-rw-r--r--libavformat/sierravmd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/sierravmd.c b/libavformat/sierravmd.c
index fa1730931a..fd75fc8d76 100644
--- a/libavformat/sierravmd.c
+++ b/libavformat/sierravmd.c
@@ -196,6 +196,10 @@ static int vmd_read_header(AVFormatContext *s,
vmd->frame_table = NULL;
raw_frame_table_size = vmd->frame_count * 6;
raw_frame_table = av_malloc(raw_frame_table_size);
+ if(vmd->frame_count * vmd->frames_per_block >= UINT_MAX / sizeof(vmd_frame_t)){
+ av_log(s, AV_LOG_ERROR, "vmd->frame_count * vmd->frames_per_block too large\n");
+ return -1;
+ }
vmd->frame_table = av_malloc(vmd->frame_count * vmd->frames_per_block * sizeof(vmd_frame_t));
if (!raw_frame_table || !vmd->frame_table) {
av_free(raw_frame_table);