This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Generic framebuffer support


Hi!

I think I have found a bug in the generic framebuffer code in function
"cyg_fb_linear_move_block_16_impl" in "linear.c".
I think the code below should either init source and dest with
(height-1) or do the decrements before the memcpy in the for loop.


    // There is an overlap. Can we do a safe bottom-to-top lot of memcpy()'s ?
    if (new_y > y) {
        source = (cyg_uint16*)(((cyg_uint8*)source) + (height * stride8));
        dest   = (cyg_uint16*)(((cyg_uint8*)dest)   + (height * stride8));
        width <<= 1;
        for ( ; height; height--) {
            __builtin_memcpy(dest, source, width);
            source   = (cyg_uint16*)(((cyg_uint8*)source) - stride8);
            dest     = (cyg_uint16*)(((cyg_uint8*)dest) - stride8);
        }
        return;
    }


Gábor

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]