Mercurial > libavcodec.hg
comparison bmp.c @ 4445:fc9a42d0e848 libavcodec
Fix memcpy out-of-bounds.
patch by Michel Bardiaux, mbardiaux mediaxim be
author | diego |
---|---|
date | Wed, 31 Jan 2007 11:19:48 +0000 |
parents | 3af19e140d67 |
children | 8ecfb7ecbb53 |
comparison
equal
deleted
inserted
replaced
4444:73b81d87c846 | 4445:fc9a42d0e848 |
---|---|
185 } | 185 } |
186 | 186 |
187 switch(depth){ | 187 switch(depth){ |
188 case 24: | 188 case 24: |
189 for(i = 0; i < avctx->height; i++){ | 189 for(i = 0; i < avctx->height; i++){ |
190 memcpy(ptr, buf, n); | 190 memcpy(ptr, buf, avctx->width*(depth>>3)); |
191 buf += n; | 191 buf += n; |
192 ptr += linesize; | 192 ptr += linesize; |
193 } | 193 } |
194 break; | 194 break; |
195 case 16: | 195 case 16: |