Mercurial > libavcodec.hg
changeset 1529:cb523a2ca00f libavcodec
fix the case where all vlc codes are 8 bits long (repeat=256)
author | michael |
---|---|
date | Mon, 13 Oct 2003 19:38:34 +0000 |
parents | ca634e47065c |
children | 3b31998fe22f |
files | huffyuv.c |
diffstat | 1 files changed, 4 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/huffyuv.c Mon Oct 13 18:17:58 2003 +0000 +++ b/huffyuv.c Mon Oct 13 19:38:34 2003 +0000 @@ -438,14 +438,13 @@ int index= s->avctx->extradata_size; for(i=0; i<256;){ - int cur=i; int val= len[i]; - int repeat; + int repeat=0; - for(; i<256 && len[i]==val; i++); + for(; i<256 && len[i]==val && repeat<255; i++) + repeat++; - repeat= i - cur; - + assert(val < 32 && val >0 && repeat<256 && repeat>0); if(repeat>7){ ((uint8_t*)s->avctx->extradata)[index++]= val; ((uint8_t*)s->avctx->extradata)[index++]= repeat;