avcodec/webp: Factor update_canvas_size() out