- Don't leak memory - Actually write proper value for clr_important in video strf - Don't write outside buffer when writing avih - end() runs in main context, so it must use request_flush_buffers, and not flush_buffers.