Hi, > ... > switch(depth){ > case 24: > for(i = 0; i < avctx->height; i++){ > memcpy(ptr, buf, n); > buf += n; > ptr += linesize; > } > break; > ... > > Should it not be memcpy(ptr, buf, linesize) ? n probably means input linesize, while linesize is the output linesize. I guess 24bit BMP doesnt stores the padding 1 byte. -- Alex