Mercurial > libavcodec.hg
changeset 2787:af90d5dc83f0 libavcodec
fix infinite loop (suggested change by rjayne at convera dot com)
fixes bug #1160195
author | michael |
---|---|
date | Mon, 11 Jul 2005 22:34:34 +0000 |
parents | ee07e99e034f |
children | 1bf080e490db |
files | cinepak.c |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/cinepak.c Mon Jul 11 22:15:03 2005 +0000 +++ b/cinepak.c Mon Jul 11 22:34:34 2005 +0000 @@ -274,6 +274,9 @@ while ((data + 4) <= eod) { chunk_id = BE_16 (&data[0]); chunk_size = BE_16 (&data[2]) - 4; + if(chunk_size < 0) + return -1; + data += 4; chunk_size = ((data + chunk_size) > eod) ? (eod - data) : chunk_size;