Mercurial > libavformat.hg
changeset 5207:f08a788606d5 libavformat
Fix overflow check insufficiently improved in r19840.
It assumes that sizeof(vmd_frame) < 64k, otherwise an additional
check to ensure sound_buffers <= UINT_MAX / sizeof(vmd_frame) would be necessary.
author | reimar |
---|---|
date | Wed, 16 Sep 2009 15:12:23 +0000 |
parents | 08c92d88d980 |
children | af13c900ff26 |
files | sierravmd.c |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/sierravmd.c Wed Sep 16 12:26:59 2009 +0000 +++ b/sierravmd.c Wed Sep 16 15:12:23 2009 +0000 @@ -161,7 +161,7 @@ vmd->frame_table = NULL; sound_buffers = AV_RL16(&vmd->vmd_header[808]); raw_frame_table_size = vmd->frame_count * 6; - if(vmd->frame_count * vmd->frames_per_block >= (UINT_MAX - sound_buffers) / sizeof(vmd_frame)){ + if(vmd->frame_count * vmd->frames_per_block >= UINT_MAX / sizeof(vmd_frame) - sound_buffers){ av_log(s, AV_LOG_ERROR, "vmd->frame_count * vmd->frames_per_block too large\n"); return -1; }