X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.0%2Fguicast%2Fbcbitmap.C;h=dedb03b49ec6f56a01362619ab4df399947edf28;hb=39d4e483b6daeb2d0eb2a6eec5b2e96552e22c5b;hp=c508de5c00edcbffa56113a375a533408689e5c9;hpb=69c3758212c57953f3932b62f994828d5eef49d2;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.0/guicast/bcbitmap.C b/cinelerra-5.0/guicast/bcbitmap.C index c508de5c..dedb03b4 100644 --- a/cinelerra-5.0/guicast/bcbitmap.C +++ b/cinelerra-5.0/guicast/bcbitmap.C @@ -219,7 +219,9 @@ BC_XvImage::BC_XvImage(BC_Bitmap *bitmap, int index, int id = BC_CModels::bc_to_x(color_model); xv_image = XvCreateImage(display, bitmap->xv_portid, id, 0, w, h); dataSize = xv_image->data_size; - data = new unsigned char[dataSize + 8]; + long data_sz = dataSize + 8; + data = new unsigned char[data_sz]; + memset(data, 0, data_sz); xv_image->data = (char *) data; w = xv_image->width; h = xv_image->height; @@ -250,7 +252,9 @@ BC_XImage::BC_XImage(BC_Bitmap *bitmap, int index, bytesPerLine = ximage->bytes_per_line; bitsPerPixel = ximage->bits_per_pixel; dataSize = h * bytesPerLine; - data = new unsigned char[dataSize + 8]; + long data_sz = dataSize + 8; + data = new unsigned char[data_sz]; + memset(data, 0, data_sz); ximage->data = (char*) data; row_data = new unsigned char*[h]; for( int i=0; iis_avail() ) { - avail.remove_pointer(buffer); delete buffer; } else { @@ -429,10 +432,10 @@ update_buffers(int count, int lock_avail) ++i; } } - if( lock_avail ) avail_lock->unlock(); delete [] buffers; buffers = new_buffers; buffer_count = count; + if( lock_avail ) avail_lock->unlock(); //top_level->unlock_window(); }